Build 1.0_r1(from source)

java.security
Class UnresolvedPermission

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

public final class UnresolvedPermission
extends Permission
implements Serializable

Holds permissions which are of an unknown type when a policy file is read. Technically, the resolution of UnresolvedPermissions and substitution by actual permissions takes place in the implies() method of a Permissions collection, right before actual checking.

See Also:
Serialized Form

Constructor Summary
UnresolvedPermission(String type, String name, String actions, Certificate[] certs)
          Constructs a new instance of this class with its type, name, and certificates set to the arguments by definition, actions are ignored
 
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.
 String getUnresolvedActions()
           
 Certificate[] getUnresolvedCerts()
           
 String getUnresolvedName()
           
 String getUnresolvedType()
           
 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.
(package private)  Permission resolve(Class targetType)
          Tries to resolve this permission into the specified class.
 String toString()
          Returns a string containing a concise, human-readable description of the receiver.
 
Methods inherited from class java.security.Permission
checkGuard, getName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnresolvedPermission

public UnresolvedPermission(String type,
                            String name,
                            String actions,
                            Certificate[] certs)
Constructs a new instance of this class with its type, name, and certificates set to the arguments by definition, actions are ignored

Parameters:
type - class of permission object
name - identifies the permission that could not be resolved
actions -
certs -
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. In this case, the receiver and the object must have the same class, permission name, actions, and certificates

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 otherwise.
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 UnresolvedPermission objects have no actions, answer the empty string.

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

getUnresolvedName

public String getUnresolvedName()

getUnresolvedActions

public String getUnresolvedActions()

getUnresolvedType

public String getUnresolvedType()

getUnresolvedCerts

public Certificate[] getUnresolvedCerts()

implies

public boolean implies(Permission permission)
Indicates whether the argument permission is implied by the receiver. UnresolvedPermission objects imply nothing because nothing is known about them yet. Before actual implication checking, this method tries to resolve UnresolvedPermissions (if any) against the passed instance. Successfully resolved permissions (if any) are taken into account during further processing.

Specified by:
implies in class Permission
Parameters:
permission - the permission to check
Returns:
always replies false

toString

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

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

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

resolve

Permission resolve(Class targetType)
Tries to resolve this permission into the specified class. It is assumed that the class has a proper name (as returned by getName() of this unresolved permission), so no check is performed to verify this. However, the class must have all required certificates (as per getUnresolvedCerts()) among the passed collection of signers. If it does, a zero, one, and/or two-argument constructor is tried to instantiate a new permission, which is then returned.
If an appropriate constructor is not available or the class is improperly signed, null is returned.

Parameters:
targetType - - a target class instance, must not be null
signers - - actual signers of the targetType
Returns:
resolved permission or null

Build 1.0_r1(from source)

Please submit a feedback, bug or feature