|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ojb.broker.util.BaseConfiguration
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 java.lang.String |
filename
the name of the properties file |
protected java.util.Properties |
properties
the properties object holding the configuration data |
Constructor Summary | |
BaseConfiguration()
The constructor loads the configuration from file |
Method Summary | |
boolean |
getBoolean(java.lang.String key,
boolean defaultValue)
Returns the boolean value for the specified key. |
java.lang.Class |
getClass(java.lang.String key,
java.lang.Class defaultValue)
Returns the class specified by the value for the specified key. |
java.lang.Class |
getClass(java.lang.String key,
java.lang.Class defaultValue,
java.lang.Class assignable)
Returns the class specified by the value for the specified key. |
java.lang.Class |
getClass(java.lang.String key,
java.lang.Class defaultValue,
java.lang.Class[] assignables)
Returns the class specified by the value for the specified key. |
int |
getInteger(java.lang.String key,
int defaultValue)
Returns the integer value for the specified key. |
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Returns the string value for the specified key. |
java.lang.String[] |
getStrings(java.lang.String key,
java.lang.String defaultValue)
Gets an array of Strings from the value of the specified key, seperated by ";". |
java.lang.String[] |
getStrings(java.lang.String key,
java.lang.String defaultValue,
java.lang.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(java.lang.String name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String filename
protected java.util.Properties properties
Constructor Detail |
public BaseConfiguration()
Method Detail |
public java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
defaultValue
is returned.
key
- the keydefaultValue
- the default value
defaultValue
public java.lang.String[] getStrings(java.lang.String key, java.lang.String defaultValue, java.lang.String seperators)
seperators
. If no value for this key
is found the array contained in defaultValue
is returned.
key
- the keydefaultValue
- the default Valueseperators
- the seprators to be used
defaultValue
StringTokenizer
public java.lang.String[] getStrings(java.lang.String key, java.lang.String defaultValue)
defaultValue
is returned.
key
- the keydefaultValue
- the default Value
defaultValue
public int getInteger(java.lang.String key, int defaultValue)
defaultValue
is returned.
key
- the keydefaultValue
- the default Value
defaultValue
public boolean getBoolean(java.lang.String key, boolean defaultValue)
defaultValue
is returned.
key
- the keydefaultValue
- the default Value
defaultValue
#trueValues
,
#falseValues
public java.lang.Class getClass(java.lang.String key, java.lang.Class defaultValue, java.lang.Class[] assignables)
assignables
defaultValue
is returned.
key
- the keydefaultValue
- the default Valueassignables
- classes and/or interfaces the specified class must extend/implement.
defaultValue
public java.lang.Class getClass(java.lang.String key, java.lang.Class defaultValue, java.lang.Class assignable)
assignable
defaultValue
is returned.
key
- the keydefaultValue
- the default Valueassignable
- a classe and/or interface the specified class must extend/implement.
defaultValue
public java.lang.Class getClass(java.lang.String key, java.lang.Class defaultValue)
defaultValue
is returned.
key
- the keydefaultValue
- the default Value
defaultValue
protected void load()
protected void setFilename(java.lang.String name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |