org.apache.commons.configuration
public class SubsetConfiguration extends AbstractConfiguration
A subset of another configuration. The new Configuration object contains every key from the parent Configuration that starts with prefix. The prefix is removed from the keys in the subset.
It is usually not necessary to use this class directly. Instead the
subset
method should be used,
which will return a correctly initialized instance.
Version: $Revision: 501987 $, $Date: 2007-01-31 21:57:04 +0100 (Mi, 31 Jan 2007) $
Field Summary | |
---|---|
protected String | delimiter The prefix delimiter |
protected Configuration | parent The parent configuration. |
protected String | prefix The prefix used to select the properties. |
Constructor Summary | |
---|---|
SubsetConfiguration(Configuration parent, String prefix)
Create a subset of the specified configuration
| |
SubsetConfiguration(Configuration parent, String prefix, String delimiter)
Create a subset of the specified configuration
|
Method Summary | |
---|---|
void | addPropertyDirect(String key, Object value) |
void | clearProperty(String key) |
boolean | containsKey(String key) |
protected String | getChildKey(String key)
Return the key in the subset configuration associated to the specified
key in the parent configuration.
|
Iterator | getKeys(String prefix) |
Iterator | getKeys() |
char | getListDelimiter()
Returns the list delimiter. |
Configuration | getParent()
Return the parent configuation for this subset.
|
protected String | getParentKey(String key)
Return the key in the parent configuration associated to the specified
key in this subset.
|
String | getPrefix()
Return the prefix used to select the properties in the parent configuration.
|
Object | getProperty(String key) |
protected Object | interpolate(Object base) |
protected String | interpolate(String base) |
boolean | isDelimiterParsingDisabled()
Returns a flag whether string properties should be checked for list
delimiter characters. |
boolean | isEmpty() |
boolean | isThrowExceptionOnMissing()
{@inheritDoc }
The subset inherits this feature from its parent if it supports this feature. |
void | setDelimiterParsingDisabled(boolean delimiterParsingDisabled)
Sets a flag whether list parsing is disabled. |
void | setListDelimiter(char delim)
Sets the list delimiter. |
void | setPrefix(String prefix)
Set the prefix used to select the properties in the parent configuration.
|
void | setProperty(String key, Object value) |
void | setThrowExceptionOnMissing(boolean throwExceptionOnMissing)
{@inheritDoc }
Change the behaviour of the parent configuration if it supports this feature. |
Configuration | subset(String prefix) |
Parameters: parent The parent configuration prefix The prefix used to select the properties
Parameters: parent The parent configuration prefix The prefix used to select the properties delimiter The prefix delimiter
Parameters: key The key in the parent configuration.
Returns: the key in the context of this subset configuration
Returns: the list delimiter
Since: 1.4
Returns: the parent configuration
Parameters: key The key in the subset.
Returns: the key as to be used by the parent
Returns: the prefix used by this subset
Returns: the delimiter parsing disabled flag
Since: 1.4
Parameters: delimiterParsingDisabled the delimiter parsing disabled flag
Since: 1.4
Parameters: delim the new list delimiter
Since: 1.4
Parameters: prefix the prefix