org.apache.commons.configuration
Class BaseConfiguration
java.lang.Object
|
+--org.apache.commons.configuration.AbstractConfiguration
|
+--org.apache.commons.configuration.BaseConfiguration
- All Implemented Interfaces:
- Configuration
- Direct Known Subclasses:
- AbstractFileConfiguration
- public class BaseConfiguration
- extends AbstractConfiguration
Basic configuration classe. Stores the configuration data but does not
provide any load or save functions. If you want to load your Configuration
from a file use PropertiesConfiguration or XmlConfiguration.
This class extends normal Java properties by adding the possibility
to use the same key many times concatenating the value strings
instead of overwriting them.
- Version:
- $Id: BaseConfiguration.java 239602 2005-08-24 11:15:27Z ebourg $
- Author:
- Stefano Mazzocchi, Jon S. Stevens, Dave Bryson, Geir Magnusson Jr., Leon Messerschmidt, Kent Johnson, Daniel Rall, Ilkka Priha, Jason van Zyl, Martin Poeschl, Henning P. Schmiedehausen, Konstantin Shaposhnikov, Oliver Heger
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, getShort, getShort, getShort, getString, getString, getStringArray, interpolate, interpolate, interpolateHelper, isThrowExceptionOnMissing, resolveContainerStore, setDelimiter, setProperty, setThrowExceptionOnMissing, subset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseConfiguration
public BaseConfiguration()
addPropertyDirect
protected void addPropertyDirect(String key,
Object value)
- Adds a key/value pair to the map. This routine does no magic morphing.
It ensures the keylist is maintained
- Overrides:
addPropertyDirect
in class AbstractConfiguration
- Parameters:
key
- key to use for mappingvalue
- object to store
getProperty
public Object getProperty(String key)
- Read property from underlying map.
- Parameters:
key
- key to use for mapping- Returns:
- object associated with the given configuration key.
isEmpty
public boolean isEmpty()
- Check if the configuration is empty
- Overrides:
isEmpty
in class AbstractConfiguration
- Returns:
true
if Configuration is empty,
false
otherwise.
containsKey
public boolean containsKey(String key)
- check if the configuration contains the key
- Overrides:
containsKey
in class AbstractConfiguration
- Parameters:
key
- the configuration key- Returns:
true
if Configuration contain given key,
false
otherwise.
clearProperty
public void clearProperty(String key)
- Clear a property in the configuration.
- Overrides:
clearProperty
in class AbstractConfiguration
- Parameters:
key
- the key to remove along with corresponding value.
clear
public void clear()
- {@inheritDoc}
- Overrides:
clear
in class AbstractConfiguration
getKeys
public Iterator getKeys()
- Get the list of the keys contained in the configuration
repository.
- Overrides:
getKeys
in class AbstractConfiguration
- Returns:
- An Iterator.
Copyright © 2001-2005 The Apache Software Foundation. All Rights Reserved.