Top Description Fields Constructors Methods
com.jogamp.common.util

public Class PropertyAccess

extends Object
Class Inheritance
Known Direct Subclasses
jogamp.common.Debug
Imports
java.security.*, java.util.HashSet

Helper routines for accessing properties.

Field Summary

Modifier and TypeField and Description
public static final String
javaws_prefix

trusted build-in property prefix 'javaws.'

public static final String
jnlp_prefix

trusted build-in property prefix 'jnlp.'

pack-priv static final HashSet<String>
pack-priv static final HashSet<String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected static final void
addTrustedPrefix(final String
New prefix to be registered as trusted.
prefix
)

public static final boolean
getBooleanProperty(final String property, final boolean jnlpAlias)

public static final boolean
getBooleanProperty(final String property, final boolean jnlpAlias, final boolean defaultValue)

public static final int
getIntProperty(final String property, final boolean jnlpAlias, final int defaultValue)

public static final long
getLongProperty(final String property, final boolean jnlpAlias, final long defaultValue)

public static final String

Returns:

the property value if exists, or null
getProperty
(final String
the property name to query.
propertyKey
,
final boolean
true if a fallback attempt to query the JNLP aliased trusted property shall be made, otherwise false.
jnlpAlias
)

Query the property with the name propertyKey.

public static final String
getProperty(final String propertyKey, final boolean jnlpAlias, final String defaultValue)

See getProperty(String, boolean), additionally allows a defaultValue if property value is null.

private static final String
getTrustedPropKey(final String propertyKey)

public static final boolean
isPropertyDefined(final String property, final boolean jnlpAlias)

public static final boolean
isTrusted(final String propertyKey)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

javaws_prefixback to summary
public static final String javaws_prefix

trusted build-in property prefix 'javaws.'

jnlp_prefixback to summary
public static final String jnlp_prefix

trusted build-in property prefix 'jnlp.'

trustedback to summary
pack-priv static final HashSet<String> trusted
trustedPrefixesback to summary
pack-priv static final HashSet<String> trustedPrefixes

Constructor Detail

PropertyAccessback to summary
public PropertyAccess()

Method Detail

addTrustedPrefixback to summary
protected static final void addTrustedPrefix(final String prefix) throws AccessControlException
Parameters
prefix:String

New prefix to be registered as trusted.

Exceptions
AccessControlException:
as thrown by SecurityUtil#checkAllPermissions().
getBooleanPropertyback to summary
public static final boolean getBooleanProperty(final String property, final boolean jnlpAlias)
See Also
getProperty(String, boolean)
getBooleanPropertyback to summary
public static final boolean getBooleanProperty(final String property, final boolean jnlpAlias, final boolean defaultValue)
See Also
getProperty(String, boolean)
getIntPropertyback to summary
public static final int getIntProperty(final String property, final boolean jnlpAlias, final int defaultValue)
See Also
getProperty(String, boolean)
getLongPropertyback to summary
public static final long getLongProperty(final String property, final boolean jnlpAlias, final long defaultValue)
See Also
getProperty(String, boolean)
getPropertyback to summary
public static final String getProperty(final String propertyKey, final boolean jnlpAlias) throws SecurityException, NullPointerException, IllegalArgumentException

Query the property with the name propertyKey.

If jnlpAlias is true and the plain propertyKey could not be resolved, an attempt to resolve the JNLP aliased trusted property is made.
Example: For the propertyName OneTwo, the jnlp alias name is jnlp.OneTwo, which is considered trusted.

Parameters
propertyKey:String

the property name to query.

jnlpAlias:boolean

true if a fallback attempt to query the JNLP aliased trusted property shall be made, otherwise false.

Returns:String

the property value if exists, or null

Exceptions
SecurityException:
if access is not allowed to the given propertyKey
NullPointerException:
if the property name is null
IllegalArgumentException:
if the property name is of length 0
See Also
System#getProperty(String)
getPropertyback to summary
public static final String getProperty(final String propertyKey, final boolean jnlpAlias, final String defaultValue) throws SecurityException, NullPointerException, IllegalArgumentException

See getProperty(String, boolean), additionally allows a defaultValue if property value is null.

getTrustedPropKeyback to summary
private static final String getTrustedPropKey(final String propertyKey)
isPropertyDefinedback to summary
public static final boolean isPropertyDefined(final String property, final boolean jnlpAlias)
See Also
getProperty(String, boolean)
isTrustedback to summary
public static final boolean isTrusted(final String propertyKey)