O'Reilly logo

Java Security by Scott Oaks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, Permissions ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required