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 BeanHelperThe association BeanHelper instance.private final BeanDeclarationThe underlying bean declaration.private final ObjectThe parameter for the bean factory. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBeanCreationContextImpl(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 theBeanDeclarationwith the data for the new bean.Gets the (optional) parameter object for the bean factory.voidinitBean(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
-
createBean
Description copied from interface:BeanCreationContextCreates 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:
createBeanin interfaceBeanCreationContext- Parameters:
data- theBeanDeclarationdescribing the bean- Returns:
- the bean created based on this declaration
-
getBeanClass
Description copied from interface:BeanCreationContextGets the class of the bean to be created.- Specified by:
getBeanClassin interfaceBeanCreationContext- Returns:
- the bean class
-
getBeanDeclaration
Description copied from interface:BeanCreationContextGets theBeanDeclarationwith the data for the new bean. This data is used to initialize the bean's properties.- Specified by:
getBeanDeclarationin interfaceBeanCreationContext- Returns:
- the
BeanDeclarationdefining the bean to be created
-
getParameter
Description copied from interface:BeanCreationContextGets the (optional) parameter object for the bean factory. This is a mechanism which can be used to pass custom parameters to aBeanFactory.- Specified by:
getParameterin interfaceBeanCreationContext- Returns:
- the parameter for the bean factory
-
initBean
Description copied from interface:BeanCreationContextInitializes a bean's property based on the givenBeanDeclaration.- Specified by:
initBeanin interfaceBeanCreationContext- Parameters:
bean- the bean to be initializeddata- theBeanDeclarationwith initialization data for this bean
-