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

java.lang.Objectorg.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl
- All Implemented Interfaces:
- org.apache.ojb.broker.util.configuration.Configuration
- Direct Known Subclasses:
- OjbConfiguration
- public abstract class ConfigurationAbstractImpl
- extends java.lang.Object
- implements org.apache.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: ConfigurationAbstractImpl.java,v 1.5 2002/12/24 13:28:58 arminw Exp $
| 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 org.apache.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. |
byte |
getByte(java.lang.String key,
byte defaultValue)
|
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. |
long |
getLong(java.lang.String key,
long defaultValue)
|
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(org.apache.ojb.broker.util.logging.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 |
logger
private org.apache.ojb.broker.util.logging.Logger logger
- the logger used in this class.
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
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 interfaceorg.apache.ojb.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 interfaceorg.apache.ojb.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 interfaceorg.apache.ojb.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 interfaceorg.apache.ojb.broker.util.configuration.Configuration
getLong
public long getLong(java.lang.String key, long defaultValue)
getByte
public byte getByte(java.lang.String key, byte defaultValue)
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 interfaceorg.apache.ojb.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 interfaceorg.apache.ojb.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 interfaceorg.apache.ojb.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 interfaceorg.apache.ojb.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(org.apache.ojb.broker.util.logging.Logger loggerInstance)
- Description copied from interface:
org.apache.ojb.broker.util.configuration.Configuration - this method allows to set a logger that tracks configuration events.
- Specified by:
setLoggerin interfaceorg.apache.ojb.broker.util.configuration.Configuration
|
|||||||||
| Home >> All >> org >> apache >> ojb >> broker >> util >> configuration >> [ impl overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl