Permissions (Java SE 9 & JDK 9 ) (original) (raw)


public final class Permissions
extends PermissionCollection
implements Serializable
This class represents a heterogeneous collection of Permissions. That is, it contains different types of Permission objects, organized into PermissionCollections. For example, if anyjava.io.FilePermission objects are added to an instance of this class, they are all stored in a single PermissionCollection. It is the PermissionCollection returned by a call to the newPermissionCollection method in the FilePermission class. Similarly, any java.lang.RuntimePermission objects are stored in the PermissionCollection returned by a call to thenewPermissionCollection method in the RuntimePermission class. Thus, this class represents a collection of PermissionCollections.
When the add method is called to add a Permission, the Permission is stored in the appropriate PermissionCollection. If no such collection exists yet, the Permission object's class is determined and thenewPermissionCollection method is called on that class to create the PermissionCollection and add it to the Permissions object. IfnewPermissionCollection returns null, then a default PermissionCollection that uses a hashtable will be created and used. Each hashtable entry stores a Permission object as both the key and the value.
Enumerations returned via the elements method are not fail-fast. Modifications to a collection should not be performed while enumerating over that collection.
Since:
1.2
See Also:
Permission, PermissionCollection, AllPermission

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.