Package org.wildfly.security.permission
Class AbstractPermissionCollection
- java.lang.Object
-
- java.security.PermissionCollection
-
- org.wildfly.security.permission.AbstractPermissionCollection
-
- All Implemented Interfaces:
Serializable,Iterable<Permission>,PermissionVerifier
- Direct Known Subclasses:
BooleanPermissionCollection,ByNamePermissionCollection,NameSetPermissionCollection,SimpleActionBitsPermissionCollection,SimplePermissionCollection
public abstract class AbstractPermissionCollection extends PermissionCollection implements Iterable<Permission>, PermissionVerifier
Base class for useful permission collections.- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.wildfly.security.permission.PermissionVerifier
ALL, NONE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPermissionCollection(AbstractPermission<?> sourcePermission)Construct a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(Permission permission)Add an item to this collection.protected abstract voiddoAdd(AbstractPermission<?> permission)Perform the work of adding a permission.abstract Enumeration<Permission>elements()Iterate over this permission collection.abstract Iterator<Permission>iterator()Iterate over this permission collection.abstract intsize()Get the size of this permission collection.-
Methods inherited from class java.security.PermissionCollection
elementsAsStream, implies, isReadOnly, setReadOnly, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.wildfly.security.permission.PermissionVerifier
and, checkPermission, implies, not, or, toPermissionCollection, unless, xor
-
-
-
-
Constructor Detail
-
AbstractPermissionCollection
protected AbstractPermissionCollection(AbstractPermission<?> sourcePermission)
Construct a new instance.- Parameters:
sourcePermission- the source permission for this collection (must not benull)
-
-
Method Detail
-
size
public abstract int size()
Get the size of this permission collection.- Returns:
- the size of this permission collection
-
iterator
public abstract Iterator<Permission> iterator()
Iterate over this permission collection.- Specified by:
iteratorin interfaceIterable<Permission>- Returns:
- the iterator (not
null)
-
elements
public abstract Enumeration<Permission> elements()
Iterate over this permission collection.- Specified by:
elementsin classPermissionCollection- Returns:
- the iterator (not
null)
-
add
public final void add(Permission permission)
Add an item to this collection. The permission class must be the same as the source permission's class.- Specified by:
addin classPermissionCollection- Parameters:
permission- the permission to add (must not benull)
-
doAdd
protected abstract void doAdd(AbstractPermission<?> permission)
Perform the work of adding a permission. The permission is guaranteed to be of the correct type and the collection is guaranteed to have been writable at the time theadd(Permission)method was called.- Parameters:
permission- the non-nullpermission
-
-