|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl
public abstract class ConfigurationAbstractImpl
Configuration Base Class that keeps a Properties based configuration persistent in a file. This class provides only basic infrastructure for loading etc.
Field Summary | |
---|---|
protected String |
filename
the name of the properties file |
protected Properties |
properties
the properties object holding the configuration data |
Constructor Summary | |
---|---|
ConfigurationAbstractImpl()
The constructor loads the configuration from file |
Method Summary | |
---|---|
boolean |
getBoolean(String key,
boolean defaultValue)
Returns the boolean value for the specified key. |
byte |
getByte(String key,
byte defaultValue)
|
Class |
getClass(String key,
Class defaultValue)
Returns the class specified by the value for the specified key. |
Class |
getClass(String key,
Class defaultValue,
Class assignable)
Returns the class specified by the value for the specified key. |
Class |
getClass(String key,
Class defaultValue,
Class[] assignables)
Returns the class specified by the value for the specified key. |
int |
getInteger(String key,
int defaultValue)
Returns the integer value for the specified key. |
long |
getLong(String key,
long defaultValue)
|
String |
getString(String key,
String defaultValue)
Returns the string value for the specified key. |
String[] |
getStrings(String key,
String defaultValue)
Gets an array of Strings from the value of the specified key, seperated by ";". |
String[] |
getStrings(String key,
String defaultValue,
String seperators)
Gets an array of Strings from the value of the specified key, seperated by any key from seperators . |
protected void |
load()
Loads the Configuration from the properties file. |
protected void |
setFilename(String name)
|
void |
setLogger(Logger loggerInstance)
this method allows to set a logger that tracks configuration events. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String filename
protected Properties properties
Constructor Detail |
---|
public ConfigurationAbstractImpl()
Method Detail |
---|
public String getString(String key, String defaultValue)
defaultValue
is returned.
getString
in interface Configuration
key
- the keydefaultValue
- the default value
defaultValue
public String[] getStrings(String key, String defaultValue, String seperators)
seperators
. If no value for this key
is found the array contained in defaultValue
is returned.
getStrings
in interface Configuration
key
- the keydefaultValue
- the default Valueseperators
- the seprators to be used
defaultValue
StringTokenizer
public String[] getStrings(String key, String defaultValue)
defaultValue
is returned.
getStrings
in interface Configuration
key
- the keydefaultValue
- the default Value
defaultValue
public int getInteger(String key, int defaultValue)
defaultValue
is returned.
getInteger
in interface Configuration
key
- the keydefaultValue
- the default Value
defaultValue
public long getLong(String key, long defaultValue)
public byte getByte(String key, byte defaultValue)
public boolean getBoolean(String key, boolean defaultValue)
defaultValue
is returned.
getBoolean
in interface Configuration
key
- the keydefaultValue
- the default Value
defaultValue
trueValues
,
falseValues
public Class getClass(String key, Class defaultValue, Class[] assignables)
assignables defaultValue
is returned.
getClass
in interface Configuration
key
- the keydefaultValue
- the default Valueassignables
- classes and/or interfaces the specified class must
extend/implement.
defaultValue
public Class getClass(String key, Class defaultValue, Class assignable)
assignable
defaultValue
is returned.
getClass
in interface Configuration
key
- the keydefaultValue
- the default Valueassignable
- a classe and/or interface the specified class must
extend/implement.
defaultValue
public Class getClass(String key, Class defaultValue)
defaultValue
is returned.
getClass
in interface Configuration
key
- the keydefaultValue
- the default Value
defaultValue
protected void load()
setFilename(java.lang.String)
protected void setFilename(String name)
public void setLogger(Logger loggerInstance)
Configuration
setLogger
in interface Configuration
loggerInstance
- the logger to setConfiguration.setLogger(Logger)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |