org.apache.commons.configuration.beanutils

Class ConfigurationDynaBean

public class ConfigurationDynaBean extends ConfigurationMap implements DynaBean

The ConfigurationDynaBean dynamically reads and writes configurations properties from a wrapped configuration-collection Configuration instance. It also implements a java.util.Map interface so that it can be used in JSP 2.0 Expression Language expressions.

The ConfigurationDynaBean maps nested and mapped properties to the appropriate Configuration subset using the Configuration method. Similarly, indexed properties reference lists of configuration properties using the getList method. Setting an indexed property always throws an exception.

Note: Some of the methods expect that a dot (".") is used as property delimitor for the wrapped configuration. This is true for most of the default configurations. Hierarchical configurations, for which a specific expression engine is set, may cause problems.

Since: 1.0-rc1

Version: $Revision: 492216 $, $Date: 2007-01-03 17:51:24 +0100 (Mi, 03 Jan 2007) $

Author: Ricardo Gladwell

Field Summary
static Loglog
The logger.
static StringPROPERTY_DELIMITER
Constant for the property delimiter.
Constructor Summary
ConfigurationDynaBean(Configuration configuration)
Creates a new instance of ConfigurationDynaBean and sets the configuration this bean is associated with.
Method Summary
booleancontains(String name, String key)
Objectget(String name)
Objectget(String name, int index)
Objectget(String name, String key)
DynaClassgetDynaClass()
voidremove(String name, String key)
voidset(String name, Object value)
voidset(String name, int index, Object value)
voidset(String name, String key, Object value)

Field Detail

log

private static Log log
The logger.

PROPERTY_DELIMITER

private static final String PROPERTY_DELIMITER
Constant for the property delimiter.

Constructor Detail

ConfigurationDynaBean

public ConfigurationDynaBean(Configuration configuration)
Creates a new instance of ConfigurationDynaBean and sets the configuration this bean is associated with.

Parameters: configuration the configuration

Method Detail

contains

public boolean contains(String name, String key)

get

public Object get(String name)

get

public Object get(String name, int index)

get

public Object get(String name, String key)

getDynaClass

public DynaClass getDynaClass()

remove

public void remove(String name, String key)

set

public void set(String name, Object value)

set

public void set(String name, int index, Object value)

set

public void set(String name, String key, Object value)