org.apache.commons.configuration.beanutils
Class ConfigurationDynaBean
java.lang.Object
java.util.AbstractMap
org.apache.commons.configuration.ConfigurationMap
org.apache.commons.configuration.beanutils.ConfigurationDynaBean
- All Implemented Interfaces:
- Map, DynaBean
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 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.subset(java.lang.String)
method. Similarly, indexed properties reference lists of configuration
properties using the
Configuration.getList(String)
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
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
|
Constructor Summary |
ConfigurationDynaBean(Configuration configuration)
Creates a new instance of ConfigurationDynaBean and sets
the configuration this bean is associated with. |
| Methods inherited from class java.util.AbstractMap |
clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, size, toString, values |
ConfigurationDynaBean
public ConfigurationDynaBean(Configuration configuration)
- Creates a new instance of
ConfigurationDynaBean and sets
the configuration this bean is associated with.
- Parameters:
configuration - the configuration
set
public void set(String name,
Object value)
- Specified by:
set in interface DynaBean
get
public Object get(String name)
- Specified by:
get in interface DynaBean
contains
public boolean contains(String name,
String key)
- Specified by:
contains in interface DynaBean
get
public Object get(String name,
int index)
- Specified by:
get in interface DynaBean
get
public Object get(String name,
String key)
- Specified by:
get in interface DynaBean
getDynaClass
public DynaClass getDynaClass()
- Specified by:
getDynaClass in interface DynaBean
remove
public void remove(String name,
String key)
- Specified by:
remove in interface DynaBean
set
public void set(String name,
int index,
Object value)
- Specified by:
set in interface DynaBean
set
public void set(String name,
String key,
Object value)
- Specified by:
set in interface DynaBean
Copyright © 2001-2007 The Apache Software Foundation. All Rights Reserved.