Interface BeanCreationContext
public interface BeanCreationContext
Definition of a context object storing all required information for the creation of a bean.
An object implementing this interface is passed to a BeanFactory. The interface also contains methods for the
creation and initialization of nested beans (for example constructor arguments or complex properties of the bean to be
created).
- Since:
- 2.0
-
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.
-
Method Details
-
createBean
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.- Parameters:
data- theBeanDeclarationdescribing the bean- Returns:
- the bean created based on this declaration
-
getBeanClass
Class<?> getBeanClass()Gets the class of the bean to be created.- Returns:
- the bean class
-
getBeanDeclaration
Gets theBeanDeclarationwith the data for the new bean. This data is used to initialize the bean's properties.- Returns:
- the
BeanDeclarationdefining the bean to be created
-
getParameter
Gets the (optional) parameter object for the bean factory. This is a mechanism which can be used to pass custom parameters to aBeanFactory.- Returns:
- the parameter for the bean factory
-
initBean
Initializes a bean's property based on the givenBeanDeclaration.- Parameters:
bean- the bean to be initializeddata- theBeanDeclarationwith initialization data for this bean
-