Class BeanHelper.BeanCreationContextImpl
java.lang.Object
org.apache.commons.configuration2.beanutils.BeanHelper.BeanCreationContextImpl
- All Implemented Interfaces:
BeanCreationContext
- Enclosing class:
- BeanHelper
private static final class BeanHelper.BeanCreationContextImpl
extends Object
implements BeanCreationContext
An implementation of the
BeanCreationContext
interface used by BeanHelper
to communicate with a
BeanFactory
. This class contains all information required for the creation of a bean. The methods for
creating and initializing bean instances are implemented by calling back to the provided BeanHelper
instance
(which is the instance that created this object).-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Class<?>
The class of the bean to be created.private final BeanHelper
The association BeanHelper instance.private final BeanDeclaration
The underlying bean declaration.private final Object
The parameter for the bean factory. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
BeanCreationContextImpl
(BeanHelper helper, Class<?> beanClass, BeanDeclaration data, Object param) -
Method Summary
Modifier and TypeMethodDescriptioncreateBean
(BeanDeclaration data) Creates a bean based on the givenBeanDeclaration
.Class<?>
Gets the class of the bean to be created.Gets theBeanDeclaration
with the data for the new bean.Gets the (optional) parameter object for the bean factory.void
initBean
(Object bean, BeanDeclaration data) Initializes a bean's property based on the givenBeanDeclaration
.
-
Field Details
-
beanHelper
The association BeanHelper instance. -
beanClass
The class of the bean to be created. -
data
The underlying bean declaration. -
param
The parameter for the bean factory.
-
-
Constructor Details
-
BeanCreationContextImpl
private BeanCreationContextImpl(BeanHelper helper, Class<?> beanClass, BeanDeclaration data, Object param)
-
-
Method Details
-
initBean
Description copied from interface:BeanCreationContext
Initializes a bean's property based on the givenBeanDeclaration
.- Specified by:
initBean
in interfaceBeanCreationContext
- Parameters:
bean
- the bean to be initializeddata
- theBeanDeclaration
with initialization data for this bean
-
getParameter
Description copied from interface:BeanCreationContext
Gets the (optional) parameter object for the bean factory. This is a mechanism which can be used to pass custom parameters to aBeanFactory
.- Specified by:
getParameter
in interfaceBeanCreationContext
- Returns:
- the parameter for the bean factory
-
getBeanDeclaration
Description copied from interface:BeanCreationContext
Gets theBeanDeclaration
with the data for the new bean. This data is used to initialize the bean's properties.- Specified by:
getBeanDeclaration
in interfaceBeanCreationContext
- Returns:
- the
BeanDeclaration
defining the bean to be created
-
getBeanClass
Description copied from interface:BeanCreationContext
Gets the class of the bean to be created.- Specified by:
getBeanClass
in interfaceBeanCreationContext
- Returns:
- the bean class
-
createBean
Description copied from interface:BeanCreationContext
Creates a bean based on the givenBeanDeclaration
. This method can be used to create dependent beans needed for the initialization of the bean that is actually created.- Specified by:
createBean
in interfaceBeanCreationContext
- Parameters:
data
- theBeanDeclaration
describing the bean- Returns:
- the bean created based on this declaration
-