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.DynaClass
Stores the class of this DynaBean.A map which associates property names with their defining beans. -
Constructor Summary
ConstructorsConstructorDescriptionMultiWrapDynaBean
(Collection<?> beans) Creates a new instance ofMultiWrapDynaBean
and initializes it with the given collections of beans to be wrapped. -
Method Summary
Modifier and TypeMethodDescriptionboolean
This operation is not supported by theWrapDynaBean
objects used internally by this class.private static org.apache.commons.beanutils.DynaBean
createDynaBean
(Object bean) Creates aDynaBean
object for the given bean.private org.apache.commons.beanutils.DynaBean
Returns the bean instance to which the given property belongs.org.apache.commons.beanutils.DynaClass
This implementation returns an instance ofMultiWrapDynaClass
.void
This operation is not supported by theWrapDynaBean
objects used internally by this class.void
void
void
-
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 ofMultiWrapDynaBean
and initializes it with the given collections of beans to be wrapped.- Parameters:
beans
- the wrapped beans
-
-
Method Details
-
createDynaBean
Creates aDynaBean
object for the given bean.- Parameters:
bean
- the bean- Returns:
- the
DynaBean
for this bean
-
contains
This operation is not supported by theWrapDynaBean
objects used internally by this class. Therefore, just an exception is thrown.- Specified by:
contains
in 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:
get
in interfaceorg.apache.commons.beanutils.DynaBean
-
get
- Specified by:
get
in interfaceorg.apache.commons.beanutils.DynaBean
-
get
- Specified by:
get
in interfaceorg.apache.commons.beanutils.DynaBean
-
getDynaClass
public org.apache.commons.beanutils.DynaClass getDynaClass()This implementation returns an instance ofMultiWrapDynaClass
.- Specified by:
getDynaClass
in interfaceorg.apache.commons.beanutils.DynaBean
-
remove
This operation is not supported by theWrapDynaBean
objects used internally by this class. Therefore, just an exception is thrown.- Specified by:
remove
in interfaceorg.apache.commons.beanutils.DynaBean
-
set
- Specified by:
set
in interfaceorg.apache.commons.beanutils.DynaBean
-
set
- Specified by:
set
in interfaceorg.apache.commons.beanutils.DynaBean
-
set
- Specified by:
set
in interfaceorg.apache.commons.beanutils.DynaBean
-