org.apache.commons.configuration.web

Class BaseWebConfiguration

abstract class BaseWebConfiguration extends AbstractConfiguration

An abstract base class for all web configurations.

This class implements common functionality used by all web based configurations. E.g. some methods are not supported by configurations of this type, so they throw a UnsupportedOperationException exception.

Since: 1.2

Version: $Id: BaseWebConfiguration.java 515306 2007-03-06 21:15:00Z oheger $

Author: Oliver Heger

Method Summary
protected voidaddPropertyDirect(String key, Object obj)
Adds a property to this configuration.
voidclearProperty(String key)
Removes the property with the given key.
booleancontainsKey(String key)
Checks whether the specified key is stored in this configuration.
protected ObjecthandleDelimiters(Object value)
Takes care of list delimiters in property values.
booleanisEmpty()
Checks if this configuration is empty.

Method Detail

addPropertyDirect

protected void addPropertyDirect(String key, Object obj)
Adds a property to this configuration. This operation is not supported and will throw an UnsupportedOperationException.

Parameters: key the key of the property obj the value to be added

Throws: UnsupportedOperationException because this operation is not allowed

clearProperty

public void clearProperty(String key)
Removes the property with the given key. This operation is not supported and will throw an UnsupportedOperationException.

Parameters: key the key of the property to be removed

Throws: UnsupportedOperationException because this operation is not allowed

containsKey

public boolean containsKey(String key)
Checks whether the specified key is stored in this configuration.

Parameters: key the key

Returns: a flag whether this key exists in this configuration

handleDelimiters

protected Object handleDelimiters(Object value)
Takes care of list delimiters in property values. This method checks if delimiter parsing is enabled and the passed in value contains a delimiter character. If this is the case, a split operation is performed.

Parameters: value the property value to be examined

Returns: the processed value

isEmpty

public boolean isEmpty()
Checks if this configuration is empty. This implementation makes use of the getKeys() method (which must be defined by concrete sub classes) to find out whether properties exist.

Returns: a flag whether this configuration is empty