This class encapsulates two pieces of information: a Condition type
(class name), which must implement Condition, and the arguments
passed to its constructor.
In order for a Condition represented by a ConditionInfo to be
instantiated and considered during a permission check, its Condition class
must be available from the system classpath.
The Condition class must either:
getCondition method that takes a
Bundle object and a ConditionInfo object as arguments. That
method must return an object that implements the Condition interface.
Condition interface and define a public constructor
that takes a Bundle object and a ConditionInfo object as
arguments.| Access | Constructor and Description |
|---|---|
| public | ConditionInfo(String
The fully qualified class name of the Condition represented
by this type, String[] ConditionInfo.The arguments for the Condition. These arguments are
available to the newly created Condition by calling the
args)getArgs() method.Constructs a |
| public | ConditionInfo(String
The encoded encodedCondition)ConditionInfo.Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if obj is a ConditionInfo, and has
the same type and args as this ConditionInfo object;
false otherwise.The object to test for equality with this
obj)ConditionInfo object.Overrides java. Determines the equality of two |
| private static void | escapeString(String str, StringBuilder output)
This escapes the quotes, backslashes, \n, and \r in the string using a backslash and appends the newly escaped string to a StringBuilder. |
| public final String[] | Returns: The arguments of thisConditionInfo. An empty array is
returned if the ConditionInfo has no arguments.Returns arguments of this |
| public final String | Returns: The string encoding of thisConditionInfo.Returns the string encoding of this |
| public final String | Returns: The fully qualified class name of the condition represented by thisConditionInfo.Returns the fully qualified class name of the condition represented by
this |
| public int | Returns: A hash code value for this object.Overrides java. Returns the hash code value for this object. |
| public String | Returns: The string representation of thisConditionInfo.Overrides java. Returns the string representation of this |
| private static String | unescapeString(char[] str, int begin, int end)
Takes an encoded character array and decodes it into a new String. |
| args | back to summary |
|---|---|
| private final String[] args | |
| type | back to summary |
|---|---|
| private final String type | |
| ConditionInfo | back to summary |
|---|---|
| public ConditionInfo(String type, String[] args) Constructs a
| |
| ConditionInfo | back to summary |
|---|---|
| public ConditionInfo(String encodedCondition) Constructs a
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Determines the equality of two | |
| escapeString | back to summary |
|---|---|
| private static void escapeString(String str, StringBuilder output) This escapes the quotes, backslashes, \n, and \r in the string using a backslash and appends the newly escaped string to a StringBuilder. | |
| getArgs | back to summary |
|---|---|
| public final String[] getArgs() Returns arguments of this
| |
| getEncoded | back to summary |
|---|---|
| public final String getEncoded() Returns the string encoding of this The encoded format is: [type "arg0" "arg1" ...]where argN are strings that must be encoded for proper parsing. Specifically, the ", \, carriage return, and line feed
characters must be escaped using \", \\, \r, and
\n, respectively.
The encoded string contains no leading or trailing whitespace characters. A single space character is used between type and "arg0" and between the arguments.
| |
| getType | back to summary |
|---|---|
| public final String getType() Returns the fully qualified class name of the condition represented by
this
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns the hash code value for this object.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns the string representation of this | |
| unescapeString | back to summary |
|---|---|
| private static String unescapeString(char[] str, int begin, int end) Takes an encoded character array and decodes it into a new String. | |