Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.util

Class PropertyPermission

java.lang.Object
|
+--java.security.Permission
   |
   +--java.security.BasicPermission
      |
      +--java.util.PropertyPermission


public final class PropertyPermission

extends BasicPermission

This class represents the permission to access and modify a property.
The name is the name of the property, e.g. xxx. You can also use an asterisk "*" as described in BasicPermission.
The action string is a comma-separated list of keywords. There are two possible actions:
read
Allows to read the property via System.getProperty.
write
Allows to write the property via System.setProperty.
The action string is case insensitive (it is converted to lower case).

Since:Author:See Also:

Constructor Summary

PropertyPermission(java.lang.String name, java.lang.String actions)

Constructs a PropertyPermission with the specified property.

Method Summary

booleanequals(java.lang.Object obj)

Check to see whether this object is the same as another PropertyPermission object; this is true if it has the same name and actions.
java.lang.StringgetActions()

Returns the action string.
inthashCode()

Returns the hash code for this permission.
booleanimplies(java.security.Permission p)

Check if this permission implies p.
java.security.PermissionCollectionnewPermissionCollection()

Returns a permission collection suitable to take PropertyPermission objects.

Constructor Details

PropertyPermission

public PropertyPermission(java.lang.String name, java.lang.String actions)

Constructs a PropertyPermission with the specified property. Possible actions are read and write, comma-separated and case-insensitive.

Parameters:

Throws:


Method Details

equals

public boolean equals(java.lang.Object obj)

Check to see whether this object is the same as another PropertyPermission object; this is true if it has the same name and actions.

Parameters:

Returns:


getActions

public String getActions()

Returns the action string. Note that this may differ from the string given at the constructor: The actions are converted to lowercase and may be reordered.

Returns:


hashCode

public int hashCode()

Returns the hash code for this permission. It is equivalent to getName().hashCode().

Returns:


implies

public boolean implies(java.security.Permission p)

Check if this permission implies p. This returns true iff all of the following conditions are true:

Parameters:

Returns:


newPermissionCollection

public PermissionCollection newPermissionCollection()

Returns a permission collection suitable to take PropertyPermission objects.

Returns: