PermissionCollection
implementation delegates to another
PermissionCollection
, taking care to lazily add the permission needed
to read from the given CodeSource
at first use, i.e., when either of
elements
, implies
or toString
is called, or when
the collection is serialized.
Modifier and Type | Field and Description |
---|---|
private final CodeSource | |
private volatile boolean | |
private final PermissionCollection | |
private static final long |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public void | add(Permission
the Permission object to add. permission)Implements abstract java. Adds a permission object to the current collection of permission objects. |
public Enumeration | elements()
Implements abstract java. Returns an enumeration of all the Permission objects in the collection. |
private void | |
public boolean | implies(Permission
the permission)Permission object to compare.Implements abstract java. Checks to see if the specified permission is implied by
the collection of |
public String | toString()
Overrides java. Returns a string describing this |
private Object |
cs | back to summary |
---|---|
private final CodeSource cs |
permissionAdded | back to summary |
---|---|
private volatile boolean permissionAdded |
perms | back to summary |
---|---|
private final PermissionCollection perms |
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID Hides java. |
LazyCodeSourcePermissionCollection | back to summary |
---|---|
public LazyCodeSourcePermissionCollection(PermissionCollection perms, CodeSource cs) |
add | back to summary |
---|---|
public void add(Permission permission) Implements abstract java. Doc from java. Adds a permission object to the current collection of permission objects.
|
elements | back to summary |
---|---|
public Enumeration Implements abstract java. Doc from java. Returns an enumeration of all the Permission objects in the collection.
|
ensureAdded | back to summary |
---|---|
private void ensureAdded() |
implies | back to summary |
---|---|
public boolean implies(Permission permission) Implements abstract java. Doc from java. Checks to see if the specified permission is implied by
the collection of
|
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string describing this super.toString() ( // enumerate all the Permission // objects and call toString() on them, // one per line.. ) super.toString is a call to the toString
method of this
object's superclass, which is Object . The result is
this collection's type name followed by this object's
hashcode, thus enabling clients to differentiate different
PermissionCollection objects, even if they contain the
same permissions.
|
writeReplace | back to summary |
---|---|
private Object writeReplace() On serialization, initialize and replace with the underlying permissions. This removes the laziness on deserialization.
|