public abstract class

PermissionCollection

extends Object
implements Serializable
java.lang.Object
   ↳ java.security.PermissionCollection
Known Direct Subclasses

Class Overview

PermissionCollection is the common base class for all collections that provide a convenient method for determining whether or not a given permission is implied by any of the permissions present in this collection.

A PermissionCollection is typically created by using the newPermissionCollection() factory method. If the mentioned method returns null, then a PermissionCollection of any type can be used. If a collection is returned, it must be used for holding several permissions of the particular type.

Subclasses must be implemented thread save.

Summary

Public Constructors
PermissionCollection()
Public Methods
abstract void add(Permission permission)
Adds the specified Permission to this collection.
abstract Enumeration<Permission> elements()
Returns an enumeration over all Permissions encapsulated by this PermissionCollection.
abstract boolean implies(Permission permission)
Indicates whether the specified permission is implied by this PermissionCollection.
boolean isReadOnly()
Indicates whether new permissions can be added to this PermissionCollection.
void setReadOnly()
Marks this PermissionCollection as read only, so that no new permissions can be added to it.
String toString()
Returns a string containing a concise, human-readable description of this PermissionCollection.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PermissionCollection ()

Public Methods

public abstract void add (Permission permission)

Adds the specified Permission to this collection.

Parameters
permission the Permission to add.
Throws
IllegalStateException if the collection is read only.

public abstract Enumeration<Permission> elements ()

Returns an enumeration over all Permissions encapsulated by this PermissionCollection.

Returns

public abstract boolean implies (Permission permission)

Indicates whether the specified permission is implied by this PermissionCollection.

Parameters
permission the permission to check.
Returns
  • true if the given permission is implied by the permissions in this collection, false otherwise.

public boolean isReadOnly ()

Indicates whether new permissions can be added to this PermissionCollection.

Returns
  • true if the receiver is read only, false if new elements can still be added to this PermissionCollection.

public void setReadOnly ()

Marks this PermissionCollection as read only, so that no new permissions can be added to it.

public String toString ()

Returns a string containing a concise, human-readable description of this PermissionCollection.

Returns
  • a printable representation for this PermissionCollection.