|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Environment
Access to the platform user local environment. Properties stored in the environment should be persisted across sessions, using an appropriate platform storage mechanism such as cookies.
| Method Summary | ||
|---|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Returns the available environment properties as a read-only map of property names and values. |
|
|
getProperty(java.lang.String name)
Retrieves an environment property by its name. |
|
|
getProperty(java.lang.String name,
T defaultValue)
Retrieves an environment property by its name, returning a default value if no value is available. |
|
|
getRequiredProperty(java.lang.String name)
Retrieves a required environment property by its name, throwing an exception if the value is missing. |
|
boolean |
hasProperty(java.lang.String name)
Determines if an environment property exists. |
|
void |
removeProperty(java.lang.String name)
Removes the property specified by the given name. |
|
void |
setProperties(java.util.Map<java.lang.String,java.lang.Object> map)
Sets multiple environment properties. |
|
void |
setProperty(java.lang.String name,
java.lang.Object value)
Sets an environment property. |
|
| Method Detail |
|---|
boolean hasProperty(java.lang.String name)
name - The name of the property to check.
true if the environment has the given property.<T> T getProperty(java.lang.String name)
ClassCastException will eventually be thrown if the given value is not the generic type requested.
T - The type of property value expected.name - The name of the property to retrieve.
null if there is no such property.
<T> T getProperty(java.lang.String name,
T defaultValue)
ClassCastException will eventually be thrown if the given value is not the generic type requested.
T - The type of property value expected.name - The name of the property to retrieve.defaultValue - The value to return if no such property is available, or null if there is no default value.
<T> T getRequiredProperty(java.lang.String name)
ClassCastException will eventually be thrown if the given value is not the generic type requested.
T - The type of property value expected.name - The name of the property to retrieve.
java.lang.IllegalStateException - if no such property exists.
void setProperty(java.lang.String name,
java.lang.Object value)
name - The name of the property.value - The value to associate with the name.
java.lang.IllegalArgumentException - if the given property cannot be set to the given value or cannot be changed.void setProperties(java.util.Map<java.lang.String,java.lang.Object> map)
map - The map of property names and values to set.
java.lang.IllegalArgumentException - if the given property cannot be set to the given value or cannot be changed.void removeProperty(java.lang.String name)
name - The name of the property to remove.
java.lang.IllegalArgumentException - if the given property cannot be removed.java.util.Map<java.lang.String,java.lang.Object> getProperties()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||