|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.configuration.AbstractConfiguration org.apache.commons.configuration.DatabaseConfiguration
Configuration stored in a database.
Nested Class Summary |
Nested classes inherited from class org.apache.commons.configuration.AbstractConfiguration |
AbstractConfiguration.PropertiesTokenizer |
Field Summary |
Fields inherited from class org.apache.commons.configuration.AbstractConfiguration |
END_TOKEN, START_TOKEN |
Constructor Summary | |
DatabaseConfiguration(DataSource datasource,
String table,
String keyColumn,
String valueColumn)
Build a configuration from a table.- |
|
DatabaseConfiguration(DataSource datasource,
String table,
String nameColumn,
String keyColumn,
String valueColumn,
String name)
Build a configuration from a table containing multiple configurations. |
Method Summary | |
protected void |
addPropertyDirect(String key,
Object obj)
Adds a key/value pair to the Configuration. Override this method to provide write acces to underlying Configuration store. |
void |
clearProperty(String key)
Remove a property from the configuration. |
boolean |
containsKey(String key)
Check if the configuration contains the specified key. |
Iterator |
getKeys()
Get the list of the keys contained in the configuration. |
protected Object |
getPropertyDirect(String key)
Read property. Should return null if the key doesn't
map to an existing object. |
boolean |
isEmpty()
Check if the configuration is empty. |
Methods inherited from class org.apache.commons.configuration.AbstractConfiguration |
addProperty, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDelimiter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getList, getList, getLong, getLong, getLong, getProperties, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, getVector, getVector, interpolate, interpolateHelper, isThrowExceptionOnMissing, setDelimiter, setProperty, setThrowExceptionOnMissing, split, subset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DatabaseConfiguration(DataSource datasource, String table, String nameColumn, String keyColumn, String valueColumn, String name)
datasource
- the datasource to connect to the databasetable
- the name of the table containing the configurationsnameColumn
- the column containing the name of the configurationkeyColumn
- the column containing the keys of the configurationvalueColumn
- the column containing the values of the configurationname
- the name of the configurationpublic DatabaseConfiguration(DataSource datasource, String table, String keyColumn, String valueColumn)
datasource
- the datasource to connect to the databasetable
- the name of the table containing the configurationskeyColumn
- the column containing the keys of the configurationvalueColumn
- the column containing the values of the configurationMethod Detail |
protected Object getPropertyDirect(String key)
null
if the key doesn't
map to an existing object.
getPropertyDirect
in class AbstractConfiguration
key
- key to use for mapping
protected void addPropertyDirect(String key, Object obj)
addPropertyDirect
in class AbstractConfiguration
key
- key to use for mappingobj
- object to storepublic boolean isEmpty()
isEmpty
in interface Configuration
isEmpty
in class AbstractConfiguration
public boolean containsKey(String key)
containsKey
in interface Configuration
containsKey
in class AbstractConfiguration
public void clearProperty(String key)
clearProperty
in interface Configuration
clearProperty
in class AbstractConfiguration
public Iterator getKeys()
getKeys
in interface Configuration
getKeys
in class AbstractConfiguration
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |