org.pentaho.reporting.libraries.base.config
Class DefaultConfiguration

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by org.pentaho.reporting.libraries.base.config.DefaultConfiguration
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>, Configuration, ModifiableConfiguration

public class DefaultConfiguration
extends Properties
implements ModifiableConfiguration

Default configuration.

Author:
Thomas Morgner.
See Also:
Serialized Form

Constructor Summary
DefaultConfiguration()
          Creates an empty property list with no default values.
 
Method Summary
 Iterator findPropertyKeys(String prefix)
          Searches all property keys that start with a given prefix.
 Enumeration getConfigProperties()
          Returns the configuration properties.
 String getConfigProperty(String key)
          Returns the configuration property with the specified key.
 String getConfigProperty(String key, String defaultValue)
          Returns the configuration property with the specified key (or the specified default value if there is no such property).
 void setConfigProperty(String key, String value)
          Sets the value of a configuration property.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pentaho.reporting.libraries.base.config.Configuration
clone
 

Constructor Detail

DefaultConfiguration

public DefaultConfiguration()
Creates an empty property list with no default values.

Method Detail

getConfigProperty

public String getConfigProperty(String key)
Returns the configuration property with the specified key.

Specified by:
getConfigProperty in interface Configuration
Parameters:
key - the property key.
Returns:
the property value.

getConfigProperty

public String getConfigProperty(String key,
                                String defaultValue)
Returns the configuration property with the specified key (or the specified default value if there is no such property).

If the property is not defined in this configuration, the code will lookup the property in the parent configuration.

Specified by:
getConfigProperty in interface Configuration
Parameters:
key - the property key.
defaultValue - the default value.
Returns:
the property value.

findPropertyKeys

public Iterator findPropertyKeys(String prefix)
Searches all property keys that start with a given prefix.

Specified by:
findPropertyKeys in interface Configuration
Specified by:
findPropertyKeys in interface ModifiableConfiguration
Parameters:
prefix - the prefix that all selected property keys should share
Returns:
the properties as iterator.

getConfigProperties

public Enumeration getConfigProperties()
Description copied from interface: ModifiableConfiguration
Returns the configuration properties.

Specified by:
getConfigProperties in interface Configuration
Specified by:
getConfigProperties in interface ModifiableConfiguration
Returns:
The configuration properties.

setConfigProperty

public void setConfigProperty(String key,
                              String value)
Sets the value of a configuration property.

Specified by:
setConfigProperty in interface ModifiableConfiguration
Parameters:
key - the property key.
value - the property value.