Class BaseDynaBeanMapDecorator<K>

java.lang.Object
org.apache.commons.beanutils2.BaseDynaBeanMapDecorator<K>
Type Parameters:
K - the type of the keys in the decorated map
All Implemented Interfaces:
Map<K,Object>
Direct Known Subclasses:
DynaBeanPropertyMapDecorator

public abstract class BaseDynaBeanMapDecorator<K> extends Object implements Map<K,Object>

A base class for decorators providing Map behavior on DynaBeans.

The motivation for this implementation is to provide access to DynaBean properties in technologies that are unaware of BeanUtils and DynaBeans - such as the expression languages of JSTL and JSF.

This rather technical base class implements the methods of the Map interface on top of a DynaBean. It was introduced to handle generic parameters in a meaningful way without breaking backwards compatibility of the 1.x DynaBeanMapDecorator class: A map wrapping a DynaBean should be of type Map<String, Object>. However, when using these generic parameters in DynaBeanMapDecorator this would be an incompatible change (as method signatures would have to be adapted). To solve this problem, this generic base class is added which allows specifying the key type as parameter. This makes it easy to have a new subclass using the correct generic parameters while DynaBeanMapDecorator could still remain with compatible parameters.

Since:
1.9.0