Class BeanHelper.BeanCreationContextImpl

  • All Implemented Interfaces:
    BeanCreationContext
    Enclosing class:
    BeanHelper

    private static final class BeanHelper.BeanCreationContextImpl
    extends java.lang.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

      Fields 
      Modifier and Type Field Description
      private java.lang.Class<?> beanClass
      The class of the bean to be created.
      private BeanHelper beanHelper
      The association BeanHelper instance.
      private BeanDeclaration data
      The underlying bean declaration.
      private java.lang.Object param
      The parameter for the bean factory.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object createBean​(BeanDeclaration data)
      Creates a bean based on the given BeanDeclaration.
      java.lang.Class<?> getBeanClass()
      Gets the class of the bean to be created.
      BeanDeclaration getBeanDeclaration()
      Gets the BeanDeclaration with the data for the new bean.
      java.lang.Object getParameter()
      Gets the (optional) parameter object for the bean factory.
      void initBean​(java.lang.Object bean, BeanDeclaration data)
      Initializes a bean's property based on the given BeanDeclaration.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • beanHelper

        private final BeanHelper beanHelper
        The association BeanHelper instance.
      • beanClass

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

        private final BeanDeclaration data
        The underlying bean declaration.
      • param

        private final java.lang.Object param
        The parameter for the bean factory.
    • Constructor Detail

      • BeanCreationContextImpl

        private BeanCreationContextImpl​(BeanHelper helper,
                                        java.lang.Class<?> beanClass,
                                        BeanDeclaration data,
                                        java.lang.Object param)
    • Method Detail

      • createBean

        public java.lang.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
      • 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
      • getParameter

        public java.lang.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
      • initBean

        public void initBean​(java.lang.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