Build 1.0_r1(from source)

java.security
Class Permission

java.lang.Object
  extended by java.security.Permission
All Implemented Interfaces:
Serializable, Guard
Direct Known Subclasses:
AllPermission, BasicPermission, FilePermission, PrivateCredentialPermission, SocketPermission, UnresolvedPermission

public abstract class Permission
extends Object
implements Guard, Serializable

Abstract superclass of all classes which represent permission to access system resources.

See Also:
Serialized Form

Constructor Summary
Permission(String name)
          Constructs a new instance of this class with its name set to the argument.
 
Method Summary
 void checkGuard(Object obj)
           
abstract  boolean equals(Object obj)
          Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
abstract  String getActions()
          Returns the actions associated with the receiver.
 String getName()
          Returns the name of the receiver.
abstract  int hashCode()
          Returns an integer hash code for the receiver.
abstract  boolean implies(Permission permission)
          Indicates whether the argument permission is implied by the receiver.
 PermissionCollection newPermissionCollection()
          Returns a new PermissionCollection for holding permissions of this class.
 String toString()
          Returns a string containing a concise, human-readable description of the receiver.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Permission

public Permission(String name)
Constructs a new instance of this class with its name set to the argument.

Parameters:
name - String the name of the permission.
Method Detail

equals

public abstract boolean equals(Object obj)
Description copied from class: Object
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. The implementation in Object returns true only if the argument is the exact same object as the receiver (==).

Overrides:
equals in class Object
Parameters:
obj - Object the object to compare with this object.
Returns:
boolean true if the object is the same as this object false if it is different from this object.
See Also:
Object.hashCode()

hashCode

public abstract int hashCode()
Returns an integer hash code for the receiver. Any two objects which answer true when passed to .equals must answer the same value for this method.

Overrides:
hashCode in class Object
Returns:
int the receiver's hash.
See Also:
equals(java.lang.Object)

getActions

public abstract String getActions()
Returns the actions associated with the receiver. Subclasses should return their actions in canonical form. If no actions are associated with the receiver, the empty string should be returned.

Returns:
String the receiver's actions.

implies

public abstract boolean implies(Permission permission)
Indicates whether the argument permission is implied by the receiver.

Parameters:
permission - Permission the permission to check.
Returns:
boolean true if the argument permission is implied by the receiver, and false if it is not.

getName

public final String getName()
Returns the name of the receiver.

Returns:
String the receiver's name.

checkGuard

public void checkGuard(Object obj)
                throws SecurityException
Specified by:
checkGuard in interface Guard
Throws:
SecurityException

newPermissionCollection

public PermissionCollection newPermissionCollection()
Returns a new PermissionCollection for holding permissions of this class. Answer null if any permission collection can be used.

Returns:
PermissionCollection or null a suitable permission collection for instances of the class of the receiver.

toString

public String toString()
Returns a string containing a concise, human-readable description of the receiver.

Overrides:
toString in class Object
Returns:
String a printable representation for the receiver.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature