|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts2.config.Settings
public class Settings
Handles all Struts config properties. Implementation of this class is pluggable (the
default implementation is DefaultSettings
). This gives developers to ability to customize how
Struts properties are set and retrieved. As an example, a developer may wish to check a separate property
store before delegating to the Struts one.
Key methods: Key methods for subclassers:
Constructor Summary | |
---|---|
Settings()
|
Method Summary | |
---|---|
static java.lang.String |
get(java.lang.String name)
Returns a property as an Object. |
java.lang.String |
getImpl(java.lang.String aName)
Implementation of the get(String) method. |
static Settings |
getInstance()
Gets the current settings implementation. |
static java.util.Locale |
getLocale()
Returns the Struts locale. |
static boolean |
isSet(java.lang.String name)
Determines whether or not a value has been set. |
boolean |
isSetImpl(java.lang.String name)
Implementation of the isSet(String) method. |
static java.util.Iterator |
list()
Returns an Iterator of all properties names. |
java.util.Iterator |
listImpl()
Implementation of the list() method. |
static void |
reset()
|
static void |
set(java.lang.String name,
java.lang.String value)
Sets a property. |
void |
setImpl(java.lang.String name,
java.lang.String value)
Implementation of the set(String, String) method. |
static void |
setInstance(Settings config)
Sets the current settings implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Settings()
Method Detail |
---|
public static void setInstance(Settings config) throws java.lang.IllegalStateException
config
- a Settings implementation
java.lang.IllegalStateException
- if an error occurs when setting the settings implementation.public static Settings getInstance()
public static java.util.Locale getLocale()
toString()
representation of a Locale object (i.e.,
"en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr_MAC", etc). If no locale is specified then the default VM locale is used (
Locale.getDefault()
).
public static boolean isSet(java.lang.String name)
name
- the name of the property to test.
public static java.lang.String get(java.lang.String name) throws java.lang.IllegalArgumentException
name
- the name of the property to get.
java.lang.IllegalArgumentException
- if an error occurs retrieveing the property or the property does not exist.public static java.util.Iterator list()
public boolean isSetImpl(java.lang.String name)
isSet(String)
method.
isSet(String)
public static void set(java.lang.String name, java.lang.String value) throws java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException
name
- the name of the property to set.value
- the property to set.
java.lang.IllegalArgumentException
- if an error occurs when setting the property.
java.lang.UnsupportedOperationException
- if the config implementation does not support setting properties.public void setImpl(java.lang.String name, java.lang.String value) throws java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException
set(String, String)
method.
java.lang.IllegalArgumentException
java.lang.UnsupportedOperationException
set(String, String)
public java.lang.String getImpl(java.lang.String aName) throws java.lang.IllegalArgumentException
get(String)
method.
java.lang.IllegalArgumentException
get(String)
public java.util.Iterator listImpl()
list()
method.
list()
public static void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |