Class SecurityPermission
public class SecurityPermission implements IPermission,
IEncodablePermission
{
// Methods
public void check(Object request) throws SecurityException;
public IPermission combine (IPermission other);
public int compareSet (Object other);
public IPermission copy();
public boolean decode(String tag, InputStream data);
public boolean encode(String tag, OutputStream out);
public String mapFormat(String format);
public String[] supportedFormats();
}
This class represents a permission that controls access to the JDK security classes (the java.lang.security package). Checks for the security permission are non-parameterized.
This class implements the IPermission and the IEncodablePermission interfaces.
public void check(Object request) throws SecurityException;
Performs a check on the permission object. Because checks for the security permission are non-parameterized, this method always succeeds.
Return Value:
No return value.
Parameter | Description |
request
| This parameter is ignored.
|
public IPermission combine (IPermission other);
Creates and returns a new SecurityPermission object that is a combination of the current permission object and the specified permission object. The new object allows access to exactly those resources allowed by either one of the permission objects that it was constructed from.
Return Value:
Returns a new SecurityPermission instance.
Parameter | Description |
other
| This parameter is ignored, but it must be an instance of the SecurityPermission class.
|
public int compareSet (Object other);
Compares the SecurityPermission instance with a specified permission object.
Return Value:
Returns EQUAL if the specified object is an instance of the SecurityPermission class.
Parameter | Description |
other
| The permission object that the SecurityPermission instance is compared with. The specified object must be an instance of the SecurityPermission class.
|
Exceptions:
IllegalArgumentException
if the specified Object is not an instance of the SecurityPermission class.
public IPermission copy();
Retrieves a new instance of the SecurityPermission class.
Return Value:
Returns a new SecurityPermission instance.
public boolean decode(String tag, InputStream data);
Decodes the contents of the specified data stream into this permission object. The tag parameter specifies the type of data in the stream.
Return Value:
Returns true if the decoding operation succeeded; otherwise, returns false.
Parameter | Description |
tag
| The encoding type identifier.
|
data
| The raw data to construct the object from. The type of data is specified by the tag parameter.
|
public boolean encode(String tag, OutputStream out);
Encodes the contents of this permission object and sends the encoded data to the specified stream. The tag parameter specifies the type of encoding that should be used.
Return Value:
Returns true if the encoding operation succeeded; otherwise, returns false.
Parameter | Description |
tag
| The encoding type identifier.
|
out
| The output stream to send the encoded data to.
|
public String mapFormat(String format);
Retrieves a permission-specific tag, given an encoding format. The tag is then used with the encode and decode methods to specify an encoding type.
Return Value:
Returns the permission-specific tag that corresponds to the specified format.
Parameter | Description |
format
| The encoding format to retrieve the tag for.
|
public String[] supportedFormats();
Retrieves the encoding formats that the permission type supports.
Return Value:
Returns an array of the supported format identifiers.