|
|||||||||
| Home >> All >> ojb >> broker >> util >> configuration >> [ impl overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
ojb.broker.util.configuration.impl
Class ConfigurationAbstractImpl

java.lang.Objectojb.broker.util.configuration.impl.ConfigurationAbstractImpl
- All Implemented Interfaces:
- ojb.broker.util.configuration.Configuration
- Direct Known Subclasses:
- OjbConfiguration
- public abstract class ConfigurationAbstractImpl
- extends java.lang.Object
- implements ojb.broker.util.configuration.Configuration
- extends java.lang.Object
Configuration Base Class that keeps a Properties based configuration persistent in a file. This class provides only basic infrastructure for loading etc.
- Version:
- $Id: $
| Field Summary | |
private java.lang.String[] |
falseValues
Contains all legal values for boolean configuration entries that represent false. |
protected java.lang.String |
filename
the name of the properties file |
private ojb.broker.util.logging.Logger |
logger
the logger used in this class. |
protected java.util.Properties |
properties
the properties object holding the configuration data |
private java.lang.String[] |
trueValues
Contains all legal values for boolean configuration entries that represent true. |
| Constructor Summary | |
ConfigurationAbstractImpl()
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. |
private java.lang.String |
getFilename()
|
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)
|
void |
setLogger(ojb.broker.util.logging.Logger loggerInstance)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
filename
protected java.lang.String filename
- the name of the properties file
properties
protected java.util.Properties properties
- the properties object holding the configuration data
logger
private ojb.broker.util.logging.Logger logger
- the logger used in this class.
trueValues
private java.lang.String[] trueValues
- Contains all legal values for boolean configuration entries that represent
true.
falseValues
private java.lang.String[] falseValues
- Contains all legal values for boolean configuration entries that represent
false.
| Constructor Detail |
ConfigurationAbstractImpl
public ConfigurationAbstractImpl()
- The constructor loads the configuration from file
| Method Detail |
getString
public java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
- Returns the string value for the specified key. If no value for this key
is found in the configuration
defaultValueis returned.- Specified by:
getStringin interfaceojb.broker.util.configuration.Configuration
getStrings
public 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. If no value for this key is found the array contained indefaultValueis returned.- Specified by:
getStringsin interfaceojb.broker.util.configuration.Configuration
getStrings
public 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 ";". If no value for this key
is found the array contained in
defaultValueis returned.- Specified by:
getStringsin interfaceojb.broker.util.configuration.Configuration
getInteger
public int getInteger(java.lang.String key, int defaultValue)
- Returns the integer value for the specified key. If no value for this key
is found in the configuration or the value is not an legal integer
defaultValueis returned.- Specified by:
getIntegerin interfaceojb.broker.util.configuration.Configuration
getBoolean
public boolean getBoolean(java.lang.String key, boolean defaultValue)
- Returns the boolean value for the specified key. If no value for this key
is found in the configuration or the value is not an legal boolean
defaultValueis returned.- Specified by:
getBooleanin interfaceojb.broker.util.configuration.Configuration
getClass
public 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. If no
value for this key is found in the configuration, no class of this name
can be found or the specified class is not assignable to each
class/interface in
assignables defaultValueis returned.- Specified by:
getClassin interfaceojb.broker.util.configuration.Configuration
getClass
public 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. If no
value for this key is found in the configuration, no class of this name
can be found or the specified class is not assignable
assignable defaultValueis returned.- Specified by:
getClassin interfaceojb.broker.util.configuration.Configuration
getClass
public java.lang.Class getClass(java.lang.String key, java.lang.Class defaultValue)
- Returns the class specified by the value for the specified key. If no
value for this key is found in the configuration or no class of this name
can be found
defaultValueis returned.- Specified by:
getClassin interfaceojb.broker.util.configuration.Configuration
load
protected void load()
- Loads the Configuration from the properties file.
getFilename
private java.lang.String getFilename()
setFilename
protected void setFilename(java.lang.String name)
setLogger
public void setLogger(ojb.broker.util.logging.Logger loggerInstance)
- Specified by:
setLoggerin interfaceojb.broker.util.configuration.Configuration
|
|||||||||
| Home >> All >> ojb >> broker >> util >> configuration >> [ impl overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
ojb.broker.util.configuration.impl.ConfigurationAbstractImpl