Creates a new BasicPermission with the specified name. Name is the symbolic name of the permission, such as "setFactory", "print.queueJob", or "topLevelWindow", etc.
Creates a new BasicPermission object with the specified name. The name is the symbolic name of the BasicPermission, and the actions string is currently unused.
Returns the canonical string representation of the actions, which currently is the empty string "", since there are no actions for a BasicPermission.
Returns the canonical name of this BasicPermission. All internal invocations of getName should invoke this method, so that the pre-JDK 1.6 "exitVM" and current "exitVM.*" permission are equivalent in equals/hashCode methods.
Checks if the specified permission is "implied" by this object. <P> More specifically, this method returns true if: <ul> <li> <i>p</i>'s class is the same as this object's class, and <li> <i>p</i>'s name equals or (in the case of wildcards) is implied by this object's name. For example, "a.b.*" implies "a.b.c". </ul>
Returns a new PermissionCollection object for storing BasicPermission objects.
Checks two BasicPermission objects for equality. Checks that <i>obj</i>'s class is the same as this object's class and has the same name as this object. <P> @param obj the object we are testing for equality with this object. @return true if <i>obj</i>'s class is the same as this object's class and has the same name as this BasicPermission object, false otherwise.
Returns the hash code value for this object. The hash code used is the hash code of the name, that is, {@code getName().hashCode()}, where {@code getName} is from the Permission superclass.
Implements the guard interface for a permission. The {@code SecurityManager.checkPermission} method is called, passing this permission object as the permission to check. Returns silently if access is granted. Otherwise, throws a SecurityException.
Checks if the specified permission's actions are "implied by" this object's actions. <P> This must be implemented by subclasses of Permission, as they are the only ones that can impose semantics on a Permission object.
Checks two Permission objects for equality. <P> Do not use the {@code equals} method for making access control decisions; use the {@code implies} method.
Returns the hash code value for this Permission object. <P> The required {@code hashCode} behavior for Permission Objects is the following: <ul> <li>Whenever it is invoked on the same Permission object more than once during an execution of a Java application, the {@code hashCode} method must consistently return the same integer. This integer need not remain consistent from one execution of an application to another execution of the same application. <li>If two Permission objects are equal according to the {@code equals} method, then calling the {@code hashCode} method on each of the two Permission objects must produce the same integer result. </ul>
Returns the name of this Permission. For example, in the case of a {@code java.io.FilePermission}, the name will be a pathname.
Returns the actions as a string. This is abstract so subclasses can defer creating a string representation until one is needed. Subclasses should always return actions in what they consider to be their canonical form. For example, two FilePermission objects created via the following:
Returns an empty PermissionCollection for a given Permission object, or null if one is not defined. Subclasses of class Permission should override this if they need to store their permissions in a particular PermissionCollection object in order to provide the correct semantics when the {@code PermissionCollection.implies} method is called. If null is returned, then the caller of this method is free to store permissions of this type in any PermissionCollection they choose (one that uses a Hashtable, one that uses a Vector, etc).
Returns a string describing this Permission. The convention is to specify the class name, the permission name, and the actions in the following format: '("ClassName" "name" "actions")', or '("ClassName" "name")' if actions list is null or empty.
The BasicPermission class : the Permission class, and can be used as the base class for permissions that want to follow the same naming convention as BasicPermission. <P> The name for a BasicPermission is the name of the given permission (for example, "exit", "setFactory", "print.queueJob", etc). The naming convention follows the hierarchical property naming convention. An asterisk may appear by itself, or if immediately preceded by a "." may appear at the end of the name, to signify a wildcard match. For example, "*" and "java.*" signify a wildcard match, while "*java", "a*b", and "java*" do not. <P> The action string (inherited from Permission) is unused. Thus, BasicPermission is commonly used as the base class for "named" permissions (ones that contain a name but no actions list; you either have the named permission or you don't.) Subclasses may implement actions on top of BasicPermission, if desired. <p> @see java.security.Permission @see java.security.Permissions @see java.security.PermissionCollection @see java.lang.SecurityManager
@author Marianne Mueller @author Roland Schemers