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 Details

    • beanHelper

      private final BeanHelper beanHelper
      The association BeanHelper instance.
    • beanClass

      private final Class<?> beanClass
      The class of the bean to be created.
    • data

      private final BeanDeclaration data
      The underlying bean declaration.
    • param

      private final Object param
      The parameter for the bean factory.
  • Constructor Details

  • Method Details

    • initBean

      public void initBean(Object bean, BeanDeclaration data)
      Description copied from interface: BeanCreationContext
      Initializes a bean's property based on the given BeanDeclaration.
      Specified by:
      initBean in interface BeanCreationContext
      Parameters:
      bean - the bean to be initialized
      data - the BeanDeclaration with initialization data for this bean
    • getParameter

      public Object 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 a BeanFactory.
      Specified by:
      getParameter in interface BeanCreationContext
      Returns:
      the parameter for the bean factory
    • getBeanDeclaration

      public BeanDeclaration getBeanDeclaration()
      Description copied from interface: BeanCreationContext
      Gets the BeanDeclaration with the data for the new bean. This data is used to initialize the bean's properties.
      Specified by:
      getBeanDeclaration in interface BeanCreationContext
      Returns:
      the BeanDeclaration defining the bean to be created
    • getBeanClass

      public Class<?> getBeanClass()
      Description copied from interface: BeanCreationContext
      Gets the class of the bean to be created.
      Specified by:
      getBeanClass in interface BeanCreationContext
      Returns:
      the bean class
    • createBean

      public Object createBean(BeanDeclaration data)
      Description copied from interface: BeanCreationContext
      Creates a bean based on the given BeanDeclaration. This method can be used to create dependent beans needed for the initialization of the bean that is actually created.
      Specified by:
      createBean in interface BeanCreationContext
      Parameters:
      data - the BeanDeclaration describing the bean
      Returns:
      the bean created based on this declaration