public final class Capability
extends java.lang.Object
The general convention of declaring capability strings is as follows:
command_content-type
command is the textual representation of a command the entity is
able to handle. For some common examples check the list of predefined commands
in the Commands
list.
target describes an optional restriction to the type of data that can be
handled via a given command. For example a component for text-input can only
grant access to text data, so it could declare a get_StringContentType
capability.
Modifier and Type | Field and Description |
---|---|
static char |
SEPARATOR |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
extractCommand() |
ContentType |
extractContentType() |
java.lang.String |
extractContentTypeId() |
static Capability |
getCapability(java.lang.String token) |
static Capability |
getCapability(java.lang.String command,
ContentType contentType) |
static Capability |
getCapability(java.lang.String command,
java.lang.String contentTypeId) |
java.lang.String |
getToken() |
int |
hashCode() |
boolean |
isGeneralizationOf(Capability capability)
Checks whether this abstract capability is a more generalized
version of the capability given as argument.
|
boolean |
isGeneralizationOf(java.lang.String s) |
boolean |
matches(java.lang.String s) |
java.lang.String |
toString() |
public static final char SEPARATOR
public java.lang.String getToken()
public boolean matches(java.lang.String s)
public boolean isGeneralizationOf(Capability capability)
Capability A is considered to be a generalized version of capability B when the token of A is a true prefix of the token of B and the next character in B's token after that prefix is the underscore character '_'.
So for example the get
capability is a generalized version of
the get_StringContentType
capability.
public boolean isGeneralizationOf(java.lang.String s)
isGeneralizationOf(Capability)
public java.lang.String extractCommand()
public java.lang.String extractContentTypeId()
public ContentType extractContentType()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static Capability getCapability(java.lang.String token)
public static Capability getCapability(java.lang.String command, ContentType contentType)
public static Capability getCapability(java.lang.String command, java.lang.String contentTypeId)