|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.guiseframework.platform.AbstractEnvironment
public class AbstractEnvironment
An abstract implementation of the platform user local environment.
| Constructor Summary | |
|---|---|
AbstractEnvironment()
|
|
| 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. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractEnvironment()
| Method Detail |
|---|
public boolean hasProperty(java.lang.String name)
hasProperty in interface Environmentname - The name of the property to check.
true if the environment has the given property.public <T> T getProperty(java.lang.String name)
ClassCastException will eventually be thrown if the given value is not the generic type requested.
getProperty in interface EnvironmentT - The type of property value expected.name - The name of the property to retrieve.
null if there is no such property.
public <T> T getProperty(java.lang.String name,
T defaultValue)
ClassCastException will eventually be thrown if the given value is not the generic type requested.
getProperty in interface EnvironmentT - 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.
public <T> T getRequiredProperty(java.lang.String name)
ClassCastException will eventually be thrown if the given value is not the generic type requested.
getRequiredProperty in interface EnvironmentT - The type of property value expected.name - The name of the property to retrieve.
java.lang.IllegalStateException - if no such property exists.
public void setProperty(java.lang.String name,
java.lang.Object value)
setProperty in interface Environmentname - 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.public void setProperties(java.util.Map<java.lang.String,java.lang.Object> map)
setProperties in interface Environmentmap - 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.public void removeProperty(java.lang.String name)
removeProperty in interface Environmentname - The name of the property to remove.
java.lang.IllegalArgumentException - if the given property cannot be removed.public java.util.Map<java.lang.String,java.lang.Object> getProperties()
getProperties in interface Environment
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||