|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.castor.core.util.Configuration
Abstract base class to hold Castor configuration properties.
| Constructor Summary | |
protected |
Configuration()
Default constructor. |
protected |
Configuration(java.lang.ClassLoader app,
java.lang.ClassLoader domain)
Construct a configuration that uses the specified class loaders. |
protected |
Configuration(Configuration parent)
Construct a configuration with given parent. |
| Method Summary | |
protected java.lang.Object |
get(java.lang.String key)
Searches for the property with the specified key in this property map. |
java.lang.ClassLoader |
getApplicationClassLoader()
Get classloader to be used for all classes of Castor and its required libraries. |
java.lang.Boolean |
getBoolean(java.lang.String key)
Searches for the property with the specified key in this property map. |
boolean |
getBoolean(java.lang.String key,
boolean defaultValue)
Searches for the property with the specified key in this property map. |
java.lang.Class |
getClass(java.lang.String key,
java.lang.ClassLoader loader)
Searches for the property with the specified key in this property map. |
java.lang.Class[] |
getClassArray(java.lang.String key,
java.lang.ClassLoader loader)
Searches for the property with the specified key in this property map. |
java.lang.ClassLoader |
getDomainClassLoader()
Get classloader to be used for all domain objects that are marshalled/unmarshalled or loaded from the database. |
java.lang.Integer |
getInteger(java.lang.String key)
Searches for the property with the specified key in this property map. |
int |
getInteger(java.lang.String key,
int defaultValue)
Searches for the property with the specified key in this property map. |
java.lang.Object |
getObject(java.lang.String key)
Searches for the property with the specified key in this property map. |
java.lang.Object[] |
getObjectArray(java.lang.String key,
java.lang.ClassLoader loader)
Searches for the property with the specified key in this property map. |
java.lang.String |
getString(java.lang.String key)
Searches for the property with the specified key in this property map. |
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Searches for the property with the specified key in this property map. |
java.lang.String[] |
getStringArray(java.lang.String key)
Searches for the property with the specified key in this property map. |
protected void |
loadDefaultProperties(java.lang.String path,
java.lang.String filename)
Load modul configuration from default locations. |
protected void |
loadUserProperties(java.lang.String filename)
Load common user configuration from classpath root and current working directory. |
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
Put given value associated with given key into the properties map of this configuration. |
java.lang.Object |
remove(java.lang.String key)
Remove any value previously associated with the given key from this configuration. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected Configuration()
protected Configuration(java.lang.ClassLoader app,
java.lang.ClassLoader domain)
app - Classloader to be used for all classes of Castor and its required libraries.domain - Classloader to be used for all domain objects.protected Configuration(Configuration parent)
parent - Parent configuration.| Method Detail |
public final java.lang.ClassLoader getApplicationClassLoader()
public final java.lang.ClassLoader getDomainClassLoader()
protected void loadDefaultProperties(java.lang.String path,
java.lang.String filename)
path - Path to the default configuration to load.filename - Name of the configuration file.protected void loadUserProperties(java.lang.String filename)
filename - Name of the configuration file.
public final java.lang.Object put(java.lang.String key,
java.lang.Object value)
null and not the value of the parent. This allows to distingush
if the mapping existed in this configuration or one of its parents.
NullPointerException will be thrown if the given value is
null.
key - Key of the property to put into configuration.value - Value to put into configuration associated with the given key..
public final java.lang.Object remove(java.lang.String key)
null
and not the value of the parent. This allows to distingush if the mapping existed in this
configuration or one of its parents.
null as one of the parents may still contain a mapping for the key that
was hidden by the mapping in this configuration.
key - Key of the property to remove from configuration.
protected java.lang.Object get(java.lang.String key)
null will be returned.
key - Key of the property to get from configuration.
public final java.lang.Boolean getBoolean(java.lang.String key)
null will be returned. For all other types and
string values a ConfigurationException will be thrown. This behaviour is intended for those
usecases that need distinguish between values that are missconfigured or not specified at
all.
key - Property key.
public final boolean getBoolean(java.lang.String key,
boolean defaultValue)
key - Property key.defaultValue - Default value.
public final java.lang.Integer getInteger(java.lang.String key)
null will be returned. For all other types and
string values a ConfigurationException will be thrown. This behaviour is intended for those
usecases that need distinguish between values that are missconfigured or not specified at
all.
key - Property key.
public final int getInteger(java.lang.String key,
int defaultValue)
key - Property key.defaultValue - Default value.
public final java.lang.String getString(java.lang.String key)
null will be returned. For all other types a ConfigurationException will be
thrown.
key - Property key.
public final java.lang.String getString(java.lang.String key,
java.lang.String defaultValue)
key - Property key.defaultValue - Default value.
public final java.lang.String[] getStringArray(java.lang.String key)
null will be returned. For all other
types a ConfigurationException will be thrown.
key - Property key.
public final java.lang.Class getClass(java.lang.String key,
java.lang.ClassLoader loader)
null will be returned. For all other types and if loading of the
class fails a ConfigurationException will be thrown.
key - Property key.loader - Class loader to load classes with.
public final java.lang.Class[] getClassArray(java.lang.String key,
java.lang.ClassLoader loader)
null will be returned. For all other
types and if loading of one of the classes fails a ConfigurationException will be thrown.
key - Property key.loader - Class loader to load classes with.
public final java.lang.Object getObject(java.lang.String key)
null will be returned.
key - Property key.
public final java.lang.Object[] getObjectArray(java.lang.String key,
java.lang.ClassLoader loader)
null will be returned. For all other types and if loading or instantiation of
one of the classes fails a ConfigurationException will be thrown.
key - Property key.loader - Class loader to load classes with.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||