Class HierarchicalConfiguration
java.lang.Object
org.pentaho.reporting.libraries.base.config.HierarchicalConfiguration
- All Implemented Interfaces:
Serializable, Cloneable, Configuration, ModifiableConfiguration
- Direct Known Subclasses:
PropertyFileConfiguration, SystemPropertyConfiguration
A hierarchical configuration. Such a configuration can have one or more
parent configurations providing usefull default values.
- Author:
- Thomas Morgner
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new configuration.HierarchicalConfiguration(Class booterClass) Creates a new configuration, that is able to reconnect itself to the global configuration after deserialization.HierarchicalConfiguration(Configuration parentConfiguration) Creates a new configuration. -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones this configuration.findPropertyKeys(String prefix) Searches all property keys that start with a given prefix.Returns all defined configuration properties for the report.getConfigProperty(String key) Returns the configuration property with the specified key.getConfigProperty(String key, String defaultValue) Returns the configuration property with the specified key (or the specified default value if there is no such property).voidThe new configuartion will be inserted into the list of report configuration, so that this configuration has the given report configuration instance as parent.booleanisLocallyDefined(String key) Checks, whether the given key is localy defined in this instance or whether the key's value is inherited.voidsetConfigProperty(String key, String value) Sets a configuration property.
-
Constructor Details
-
HierarchicalConfiguration
public HierarchicalConfiguration()Creates a new configuration. -
HierarchicalConfiguration
Creates a new configuration.- Parameters:
parentConfiguration- the parent configuration.
-
HierarchicalConfiguration
Creates a new configuration, that is able to reconnect itself to the global configuration after deserialization.- Parameters:
booterClass- the booter class that holds the global configuration.
-
-
Method Details
-
getConfigProperty
Returns the configuration property with the specified key.- Specified by:
getConfigPropertyin interfaceConfiguration- Parameters:
key- the property key.- Returns:
- the property value.
-
getConfigProperty
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:
getConfigPropertyin interfaceConfiguration- Parameters:
key- the property key.defaultValue- the default value.- Returns:
- the property value.
-
setConfigProperty
Sets a configuration property.- Specified by:
setConfigPropertyin interfaceModifiableConfiguration- Parameters:
key- the property key.value- the property value.
-
isLocallyDefined
Checks, whether the given key is localy defined in this instance or whether the key's value is inherited.- Parameters:
key- the key that should be checked.- Returns:
- true, if the key is defined locally, false otherwise.
-
insertConfiguration
The new configuartion will be inserted into the list of report configuration, so that this configuration has the given report configuration instance as parent.- Parameters:
config- the new report configuration.
-
getConfigProperties
Returns all defined configuration properties for the report. The enumeration contains all keys of the changed properties, properties set from files or the system properties are not included.- Specified by:
getConfigPropertiesin interfaceConfiguration- Specified by:
getConfigPropertiesin interfaceModifiableConfiguration- Returns:
- all defined configuration properties for the report.
-
findPropertyKeys
Searches all property keys that start with a given prefix.- Specified by:
findPropertyKeysin interfaceConfiguration- Specified by:
findPropertyKeysin interfaceModifiableConfiguration- Parameters:
prefix- the prefix that all selected property keys should share- Returns:
- the properties as iterator.
-
clone
Clones this configuration.- Specified by:
clonein interfaceConfiguration- Returns:
- a clone of this configuration.
- Throws:
CloneNotSupportedException
-