GeezerVison is showing docs.oracle.com — Permission (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
compact1, compact2, compact3
java.security
Class Permission
-
-
Constructor Summary
Constructors
| Constructor |
Description |
Permission(String name) |
Constructs a permission with the specified name.
|
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods
| Modifier and Type |
Method |
Description |
void |
checkGuard(Object object) |
Implements the guard interface for a permission.
|
abstract boolean |
equals(Object obj) |
Checks two Permission objects for equality.
|
abstract String |
getActions() |
Returns the actions as a String.
|
String |
getName() |
Returns the name of this Permission.
|
abstract int |
hashCode() |
Returns the hash code value for this Permission object.
|
abstract boolean |
implies(Permission permission) |
Checks if the specified permission's actions are "implied by"
this object's actions.
|
PermissionCollection |
newPermissionCollection() |
Returns an empty PermissionCollection for a given Permission object, or null if
one is not defined.
|
String |
toString() |
Returns a string describing this Permission.
|
-
-
Method Detail
-
getName
public final String getName()
Returns the name of this Permission.
For example, in the case of a java.io.FilePermission,
the name will be a pathname.
- Returns:
- the name of this Permission.
-
newPermissionCollection
public PermissionCollection newPermissionCollection()
Returns an empty PermissionCollection for a given Permission object, or null if
one is not defined. Subclasses of class Permission should
override this if they need to store their permissions in a particular
PermissionCollection object in order to provide the correct semantics
when the PermissionCollection.implies method is called.
If null is returned,
then the caller of this method is free to store permissions of this
type in any PermissionCollection they choose (one that uses a Hashtable,
one that uses a Vector, etc).
- Returns:
- a new PermissionCollection object for this type of Permission, or
null if one is not defined.
-
toString
public String toString()
Returns a string describing this Permission. The convention is to
specify the class name, the permission name, and the actions in
the following format: '("ClassName" "name" "actions")', or
'("ClassName" "name")' if actions list is null or empty.
- Overrides:
toString in class Object
- Returns:
- information about this Permission.
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|