Build 1.0_r1(from source)

java.security
Class AllPermission

java.lang.Object
  extended by java.security.Permission
      extended by java.security.AllPermission
All Implemented Interfaces:
Serializable, Guard

public final class AllPermission
extends Permission

Subclass of Permission whose instances imply all other permissions. Granting this permission is equivalent to disabling security.

See Also:
Serialized Form

Constructor Summary
AllPermission()
          Constructs a new instance of this class.
AllPermission(String name, String actions)
          Constructs a new instance of this class.
 
Method Summary
 boolean equals(Object obj)
          Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
 String getActions()
          Returns the actions associated with the receiver.
 int hashCode()
          Returns an integer hash code for the receiver.
 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.
 
Methods inherited from class java.security.Permission
checkGuard, getName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AllPermission

public AllPermission(String name,
                     String actions)
Constructs a new instance of this class. The two argument version is provided for class Policy so that it has a consistent call pattern across all Permissions. The name and action list are both ignored.

Parameters:
name - java.lang.String ignored.
actions - java.lang.String ignored.

AllPermission

public AllPermission()
Constructs a new instance of this class.

Method Detail

equals

public boolean equals(Object obj)
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. All AllPermissions are equal to each other.

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

hashCode

public 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.

Specified by:
hashCode in class Permission
Returns:
the receiver's hash
See Also:
equals(java.lang.Object)

getActions

public String getActions()
Returns the actions associated with the receiver. Since AllPermission objects allow all actions, answer with the string "".

Specified by:
getActions in class Permission
Returns:
String the actions associated with the receiver.

implies

public boolean implies(Permission permission)
Indicates whether the argument permission is implied by the receiver. AllPermission objects imply all other permissions.

Specified by:
implies in class Permission
Parameters:
permission - java.security.Permission the permission to check
Returns:
boolean true if the argument permission is implied by the receiver, and false if it is not.

newPermissionCollection

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

Overrides:
newPermissionCollection in class Permission
Returns:
a new PermissionCollection or null
See Also:
BasicPermissionCollection

Build 1.0_r1(from source)

Please submit a feedback, bug or feature