CastorProperties
, CoreProperties
, CPAProperties
, XMLProperties
public abstract class AbstractProperties
extends java.lang.Object
Modifier | Constructor | Description |
---|---|---|
protected |
AbstractProperties() |
Default constructor.
|
protected |
AbstractProperties(java.lang.ClassLoader app,
java.lang.ClassLoader domain) |
Construct properties that uses the specified class loaders.
|
protected |
AbstractProperties(AbstractProperties parent) |
Construct properties with given parent.
|
Modifier and Type | Method | Description |
---|---|---|
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 module properties from default locations.
|
protected void |
loadUserProperties(java.lang.String filename) |
Load common user properties 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 properties.
|
java.lang.Object |
remove(java.lang.String key) |
Remove any value previously associated with the given key from this properties.
|
protected AbstractProperties()
protected AbstractProperties(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 AbstractProperties(AbstractProperties parent)
parent
- Parent properties.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 properties to load.filename
- Name of the properties file.protected void loadUserProperties(java.lang.String filename)
filename
- Name of the properties 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 properties or one of its parents.
NullPointerException
will be thrown if the given value is
null
.key
- Key of the property to put into properties.value
- Value to put into properties 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
properties 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 properties.key
- Key of the property to remove from properties.protected java.lang.Object get(java.lang.String key)
null
will be returned.key
- Key of the property to get from properties.public final java.lang.Boolean getBoolean(java.lang.String key)
null
will be returned. For all other types and
string values a PropertiesException 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 PropertiesException 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 PropertiesException 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 PropertiesException 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 PropertiesException 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 PropertiesException 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 PropertiesException will be thrown.key
- Property key.loader
- Class loader to load classes with.Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com