Class ConfigurationDynaBean
- java.lang.Object
-
- java.util.AbstractMap<Object,Object>
-
- org.apache.commons.configuration2.ConfigurationMap
-
- org.apache.commons.configuration2.beanutils.ConfigurationDynaBean
-
public class ConfigurationDynaBean extends ConfigurationMap implements org.apache.commons.beanutils.DynaBean
TheConfigurationDynaBeandynamically reads and writes configurations properties from a wrapped configuration-collectionConfigurationinstance. It also implements aMapinterface so that it can be used in JSP 2.0 Expression Language expressions.The
ConfigurationDynaBeanmaps nested and mapped properties to the appropriateConfigurationsubset using theConfiguration.subset(java.lang.String)method. Similarly, indexed properties reference lists of configuration properties using theImmutableConfiguration.getList(String)method. Setting an indexed property is supported, too.Note: Some of the methods expect that a dot (".") is used as property delimiter 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description ConfigurationDynaBean(Configuration configuration)Constructs a new instance ofConfigurationDynaBeanand sets the configuration this bean is associated with.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(String name, String key)Objectget(String name)Objectget(String name, int index)Objectget(String name, String key)org.apache.commons.beanutils.DynaClassgetDynaClass()voidremove(String name, String key)voidset(String name, int index, Object value)voidset(String name, Object value)voidset(String name, String key, Object value)-
Methods inherited from class org.apache.commons.configuration2.ConfigurationMap
entrySet, get, getConfiguration, put
-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
ConfigurationDynaBean
public ConfigurationDynaBean(Configuration configuration)
Constructs a new instance ofConfigurationDynaBeanand sets the configuration this bean is associated with.- Parameters:
configuration- the configuration
-
-
Method Detail
-
set
public void set(String name, Object value)
- Specified by:
setin interfaceorg.apache.commons.beanutils.DynaBean
-
get
public Object get(String name)
- Specified by:
getin interfaceorg.apache.commons.beanutils.DynaBean
-
contains
public boolean contains(String name, String key)
- Specified by:
containsin interfaceorg.apache.commons.beanutils.DynaBean
-
get
public Object get(String name, int index)
- Specified by:
getin interfaceorg.apache.commons.beanutils.DynaBean
-
get
public Object get(String name, String key)
- Specified by:
getin interfaceorg.apache.commons.beanutils.DynaBean
-
getDynaClass
public org.apache.commons.beanutils.DynaClass getDynaClass()
- Specified by:
getDynaClassin interfaceorg.apache.commons.beanutils.DynaBean
-
remove
public void remove(String name, String key)
- Specified by:
removein interfaceorg.apache.commons.beanutils.DynaBean
-
set
public void set(String name, int index, Object value)
- Specified by:
setin interfaceorg.apache.commons.beanutils.DynaBean
-
-