Name
Class java.security.PermissionCollection
Synopsis
As you might infer, a permission collection is a collection of
permission objects. In theory, a permission collection can be a set
of arbitrary, unrelated permission objects; however, that usage is
best avoided and left to the Permissions
class.
Hence, a permission collection should be thought of as a collection
of one type of permission: a set of file permissions, a set of socket
permissions, etc. A permission collection is responsible for
determining if an individual permission (passed as a parameter to the
implies( )
method) is contained in the set of
permissions in the object; presumably, it will do that more
efficiently than by calling the implies( )
method on each permission in the collection. If you implement a new
permission class that has wildcard semantics for its names, then you
must implement a corresponding permission collection to aggregate
instances of that class (if you don’t need wildcard matching,
the default implementation of the Permission
class will provide an appropriate collection).
Class Definition
public abstract class java.security.PermissionCollection extends java.lang.Object implements java.io.Serializable { // Constructors public PermissionCollection( ); // Instance Methods public abstract void add(Permission); public abstract Enumeration elements( ); public abstract boolean implies(Permission); public boolean isReadOnly( ); public void setReadOnly( ); public String toString( ); }
See also
Permission ... |
Get Java Security, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.