This class encapsulates three pieces of information: a Permission type
(class name), which must be a subclass of
java.security.Permission, and the name and actions
arguments passed to its constructor.
In order for a permission represented by a PermissionInfo to be
instantiated and considered during a permission check, its Permission class
must be available from the system classpath or an exported package. This
means that the instantiation of a permission represented by a
PermissionInfo may be delayed until the package containing its
Permission class has been exported by a bundle.
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final String | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | PermissionInfo(String
The fully qualified class name of the permission represented
by this type, String PermissionInfo. The class must be a subclass of
java.security.Permission and must define a 2-argument
constructor that takes a name string and an actions
string.The permission name that will be passed as the first argument
to the constructor of the name, String Permission class identified by
type.The permission actions that will be passed as the second
argument to the constructor of the actions)Permission class
identified by type.Constructs a |
| public | PermissionInfo(String
The encoded encodedPermission)PermissionInfo.Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if obj is a PermissionInfo, and has
the same type, name and actions as this PermissionInfo
object; false otherwise.The object to test for equality with this
obj)PermissionInfo object.Overrides java. Determines the equality of two |
| private static void | escapeString(String str, StringBuffer output)
This escapes the quotes, backslashes, \n, and \r in the string using a backslash and appends the newly escaped string to a StringBuffer. |
| public final String | Returns: The actions of the permission represented by thisPermissionInfo, or null if the permission does
not have any actions associated with it.Returns the actions of the permission represented by this
|
| public final String | Returns: The string encoding of thisPermissionInfo.Returns the string encoding of this |
| public final String | Returns: The name of the permission represented by thisPermissionInfo, or null if the permission does
not have a name.Returns the name of the permission represented by this
|
| public final String | Returns: The fully qualified class name of the permission represented by thisPermissionInfo.Returns the fully qualified class name of the permission 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 thisPermissionInfo.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. |
| actions | back to summary |
|---|---|
| private final String actions | |
| name | back to summary |
|---|---|
| private final String name | |
| type | back to summary |
|---|---|
| private final String type | |
| PermissionInfo | back to summary |
|---|---|
| public PermissionInfo(String type, String name, String actions) Constructs a
| |
| PermissionInfo | back to summary |
|---|---|
| public PermissionInfo(String encodedPermission) 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, StringBuffer output) This escapes the quotes, backslashes, \n, and \r in the string using a backslash and appends the newly escaped string to a StringBuffer. | |
| getActions | back to summary |
|---|---|
| public final String getActions() Returns the actions of the permission represented by this
| |
| getEncoded | back to summary |
|---|---|
| public final String getEncoded() Returns the string encoding of this The encoded format is: (type)or (type "name")or (type "name" "actions")where name and actions 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 "name" and between "name" and "actions".
| |
| getName | back to summary |
|---|---|
| public final String getName() Returns the name of the permission represented by this
| |
| getType | back to summary |
|---|---|
| public final String getType() Returns the fully qualified class name of the permission 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. | |