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:
-
Field Summary
Fields inherited from interface org.wildfly.security.permission.PermissionVerifier
ALL, NONE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPermissionCollection(AbstractPermission<?> sourcePermission) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.wildfly.security.permission.PermissionVerifier
and, checkPermission, implies, not, or, toPermissionCollection, unless, xor
-
Constructor Details
-
AbstractPermissionCollection
Construct a new instance.- Parameters:
sourcePermission- the source permission for this collection (must not benull)
-
-
Method Details
-
size
public abstract int size()Get the size of this permission collection.- Returns:
- the size of this permission collection
-
iterator
Iterate over this permission collection.- Specified by:
iteratorin interfaceIterable<Permission>- Returns:
- the iterator (not
null)
-
elements
Iterate over this permission collection.- Specified by:
elementsin classPermissionCollection- Returns:
- the iterator (not
null)
-
add
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
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
-