Class MultiWrapDynaBean
java.lang.Object
org.apache.commons.configuration2.builder.combined.MultiWrapDynaBean
- All Implemented Interfaces:
org.apache.commons.beanutils.DynaBean
An implementation of the DynaBean interfaces which wraps multiple other beans.
An instance of this class is constructed with a collection of beans to be wrapped. When reading or writing a property the wrapped bean which defines this property is determined, and the operation is executed on this bean.
The wrapped beans should have disjunct properties. Otherwise, it is undefined which bean property is read or written.
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.commons.beanutils.DynaClassStores the class of this DynaBean.A map which associates property names with their defining beans. -
Constructor Summary
ConstructorsConstructorDescriptionMultiWrapDynaBean(Collection<?> beans) Creates a new instance ofMultiWrapDynaBeanand initializes it with the given collections of beans to be wrapped. -
Method Summary
Modifier and TypeMethodDescriptionbooleanThis operation is not supported by theWrapDynaBeanobjects used internally by this class.private static org.apache.commons.beanutils.DynaBeancreateDynaBean(Object bean) Creates aDynaBeanobject for the given bean.private org.apache.commons.beanutils.DynaBeanReturns the bean instance to which the given property belongs.org.apache.commons.beanutils.DynaClassThis implementation returns an instance ofMultiWrapDynaClass.voidThis operation is not supported by theWrapDynaBeanobjects used internally by this class.voidvoidvoid
-
Field Details
-
dynaClass
private final org.apache.commons.beanutils.DynaClass dynaClassStores the class of this DynaBean. -
propsToBeans
A map which associates property names with their defining beans.
-
-
Constructor Details
-
MultiWrapDynaBean
Creates a new instance ofMultiWrapDynaBeanand initializes it with the given collections of beans to be wrapped.- Parameters:
beans- the wrapped beans
-
-
Method Details
-
createDynaBean
Creates aDynaBeanobject for the given bean.- Parameters:
bean- the bean- Returns:
- the
DynaBeanfor this bean
-
contains
This operation is not supported by theWrapDynaBeanobjects used internally by this class. Therefore, just an exception is thrown.- Specified by:
containsin interfaceorg.apache.commons.beanutils.DynaBean
-
fetchBean
Returns the bean instance to which the given property belongs. If no such bean is found, an arbitrary bean is returned. (This causes the operation on this bean to fail with a meaningful error message.)- Parameters:
property- the property name- Returns:
- the bean defining this property
-
get
- Specified by:
getin interfaceorg.apache.commons.beanutils.DynaBean
-
get
- Specified by:
getin interfaceorg.apache.commons.beanutils.DynaBean
-
get
- Specified by:
getin interfaceorg.apache.commons.beanutils.DynaBean
-
getDynaClass
public org.apache.commons.beanutils.DynaClass getDynaClass()This implementation returns an instance ofMultiWrapDynaClass.- Specified by:
getDynaClassin interfaceorg.apache.commons.beanutils.DynaBean
-
remove
This operation is not supported by theWrapDynaBeanobjects used internally by this class. Therefore, just an exception is thrown.- Specified by:
removein interfaceorg.apache.commons.beanutils.DynaBean
-
set
- Specified by:
setin interfaceorg.apache.commons.beanutils.DynaBean
-
set
- Specified by:
setin interfaceorg.apache.commons.beanutils.DynaBean
-
set
- Specified by:
setin interfaceorg.apache.commons.beanutils.DynaBean
-