| org.apache.commons.configuration.AbstractConfiguration org.apache.commons.configuration.DatabaseConfiguration
DatabaseConfiguration | public class DatabaseConfiguration extends AbstractConfiguration (Code) | | Configuration stored in a database.
since: 1.0 author: Emmanuel Bourg version: $Revision: 514234 $, $Date: 2007-03-03 21:18:14 +0100 (Sa, 03 Mrz 2007) $ |
DatabaseConfiguration | public DatabaseConfiguration(DataSource datasource, String table, String nameColumn, String keyColumn, String valueColumn, String name)(Code) | | Build a configuration from a table containing multiple configurations.
Parameters: datasource - the datasource to connect to the database Parameters: table - the name of the table containing the configurations Parameters: nameColumn - the column containing the name of the configuration Parameters: keyColumn - the column containing the keys of the configuration Parameters: valueColumn - the column containing the values of the configuration Parameters: name - the name of the configuration |
DatabaseConfiguration | public DatabaseConfiguration(DataSource datasource, String table, String keyColumn, String valueColumn)(Code) | | Build a configuration from a table.-
Parameters: datasource - the datasource to connect to the database Parameters: table - the name of the table containing the configurations Parameters: keyColumn - the column containing the keys of the configuration Parameters: valueColumn - the column containing the values of the configuration |
addProperty | public void addProperty(String key, Object value)(Code) | | Adds a property to this configuration. This implementation will
temporarily disable list delimiter parsing, so that even if the value
contains the list delimiter, only a single record will be written into
the managed table. The implementation of getProperty()
will take care about delimiters. So list delimiters are fully supported
by DatabaseConfiguration , but internally treated a bit
differently.
Parameters: key - the key of the new property Parameters: value - the value to be added |
addPropertyDirect | protected void addPropertyDirect(String key, Object obj)(Code) | | Adds a property to this configuration. If this causes a database error,
an error event will be generated of type EVENT_ADD_PROPERTY
with the causing exception. The event's propertyName is
set to the passed in property key, the propertyValue
points to the passed in value.
Parameters: key - the property key Parameters: obj - the value of the property to add |
clear | public void clear()(Code) | | Removes all entries from this configuration. If this causes a database
error, an error event will be generated of type
EVENT_CLEAR with the causing exception. Both the
event's propertyName and the propertyValue
will be undefined.
|
clearProperty | public void clearProperty(String key)(Code) | | Removes the specified value from this configuration. If this causes a
database error, an error event will be generated of type
EVENT_CLEAR_PROPERTY with the causing exception. The
event's propertyName will be set to the passed in key, the
propertyValue will be undefined.
Parameters: key - the key of the property to be removed |
containsKey | public boolean containsKey(String key)(Code) | | Checks whether this configuration contains the specified key. If this
causes a database error, an error event will be generated of type
EVENT_READ_PROPERTY with the causing exception. The
event's propertyName will be set to the passed in key, the
propertyValue will be undefined.
Parameters: key - the key to be checked a flag whether this key is defined |
getConnection | protected Connection getConnection() throws SQLException(Code) | | Returns a Connection object. This method is called when
ever the database is to be accessed. This implementation returns a
connection from the current DataSource .
the Connection object to be used throws: SQLException - if an error occurs since: 1.4 |
getDatasource | public DataSource getDatasource()(Code) | | Returns the used DataSource object.
the data source since: 1.4 |
getKeys | public Iterator getKeys()(Code) | | Returns an iterator with the names of all properties contained in this
configuration. If this causes a database
error, an error event will be generated of type
EVENT_READ_PROPERTY with the causing exception. Both the
event's propertyName and the propertyValue
will be undefined.
an iterator with the contained keys (an empty iterator in caseof an error) |
getProperty | public Object getProperty(String key)(Code) | | Returns the value of the specified property. If this causes a database
error, an error event will be generated of type
EVENT_READ_PROPERTY with the causing exception. The
event's propertyName is set to the passed in property key,
the propertyValue is undefined.
Parameters: key - the key of the desired property the value of this property |
isEmpty | public boolean isEmpty()(Code) | | Checks if this configuration is empty. If this causes a database error,
an error event will be generated of type EVENT_READ_PROPERTY
with the causing exception. Both the event's propertyName
and propertyValue will be undefined.
a flag whether this configuration is empty. |
Methods inherited from org.apache.commons.configuration.AbstractConfiguration | public void addErrorLogListener()(Code)(Java Doc) public void addProperty(String key, Object value)(Code)(Java Doc) abstract protected void addPropertyDirect(String key, Object value)(Code)(Java Doc) public void clear()(Code)(Java Doc) public void clearProperty(String key)(Code)(Java Doc) protected void clearPropertyDirect(String key)(Code)(Java Doc) abstract public boolean containsKey(String key)(Code)(Java Doc) protected ConfigurationInterpolator createInterpolator()(Code)(Java Doc) public BigDecimal getBigDecimal(String key)(Code)(Java Doc) public BigDecimal getBigDecimal(String key, BigDecimal defaultValue)(Code)(Java Doc) public BigInteger getBigInteger(String key)(Code)(Java Doc) public BigInteger getBigInteger(String key, BigInteger defaultValue)(Code)(Java Doc) public boolean getBoolean(String key)(Code)(Java Doc) public boolean getBoolean(String key, boolean defaultValue)(Code)(Java Doc) public Boolean getBoolean(String key, Boolean defaultValue)(Code)(Java Doc) public byte getByte(String key)(Code)(Java Doc) public byte getByte(String key, byte defaultValue)(Code)(Java Doc) public Byte getByte(String key, Byte defaultValue)(Code)(Java Doc) public static char getDefaultListDelimiter()(Code)(Java Doc) public static char getDelimiter()(Code)(Java Doc) public double getDouble(String key)(Code)(Java Doc) public double getDouble(String key, double defaultValue)(Code)(Java Doc) public Double getDouble(String key, Double defaultValue)(Code)(Java Doc) public float getFloat(String key)(Code)(Java Doc) public float getFloat(String key, float defaultValue)(Code)(Java Doc) public Float getFloat(String key, Float defaultValue)(Code)(Java Doc) public int getInt(String key)(Code)(Java Doc) public int getInt(String key, int defaultValue)(Code)(Java Doc) public Integer getInteger(String key, Integer defaultValue)(Code)(Java Doc) public ConfigurationInterpolator getInterpolator()(Code)(Java Doc) abstract public Iterator getKeys()(Code)(Java Doc) public Iterator getKeys(String prefix)(Code)(Java Doc) public List getList(String key)(Code)(Java Doc) public List getList(String key, List defaultValue)(Code)(Java Doc) public char getListDelimiter()(Code)(Java Doc) public Log getLogger()(Code)(Java Doc) public long getLong(String key)(Code)(Java Doc) public long getLong(String key, long defaultValue)(Code)(Java Doc) public Long getLong(String key, Long defaultValue)(Code)(Java Doc) public Properties getProperties(String key)(Code)(Java Doc) public Properties getProperties(String key, Properties defaults)(Code)(Java Doc) public short getShort(String key)(Code)(Java Doc) public short getShort(String key, short defaultValue)(Code)(Java Doc) public Short getShort(String key, Short defaultValue)(Code)(Java Doc) public String getString(String key)(Code)(Java Doc) public String getString(String key, String defaultValue)(Code)(Java Doc) public String[] getStringArray(String key)(Code)(Java Doc) public synchronized StrSubstitutor getSubstitutor()(Code)(Java Doc) protected String interpolate(String base)(Code)(Java Doc) protected Object interpolate(Object value)(Code)(Java Doc) protected String interpolateHelper(String base, List priorVariables)(Code)(Java Doc) public boolean isDelimiterParsingDisabled()(Code)(Java Doc) abstract public boolean isEmpty()(Code)(Java Doc) public boolean isThrowExceptionOnMissing()(Code)(Java Doc) protected Object resolveContainerStore(String key)(Code)(Java Doc) public static void setDefaultListDelimiter(char delimiter)(Code)(Java Doc) public static void setDelimiter(char delimiter)(Code)(Java Doc) public void setDelimiterParsingDisabled(boolean delimiterParsingDisabled)(Code)(Java Doc) public void setListDelimiter(char listDelimiter)(Code)(Java Doc) public void setLogger(Log log)(Code)(Java Doc) public void setProperty(String key, Object value)(Code)(Java Doc) public void setThrowExceptionOnMissing(boolean throwExceptionOnMissing)(Code)(Java Doc) public Configuration subset(String prefix)(Code)(Java Doc)
|
|
|