Class BeanRegistrationBeanFactoryContribution

java.lang.Object
org.springframework.beans.factory.generator.BeanRegistrationBeanFactoryContribution
All Implemented Interfaces:
BeanFactoryContribution

public class BeanRegistrationBeanFactoryContribution extends Object implements BeanFactoryContribution
A BeanFactoryContribution that registers a bean with the bean factory.
Since:
6.0
Author:
Stephane Nicoll
  • Constructor Details

  • Method Details

    • applyTo

      public void applyTo(BeanFactoryInitialization initialization)
      Description copied from interface: BeanFactoryContribution
      Contribute ahead of time optimizations to the specific BeanFactoryInitialization.
      Specified by:
      applyTo in interface BeanFactoryContribution
      Parameters:
      initialization - BeanFactoryInitialization to contribute to
    • getAttributeFilter

      protected Predicate<String> getAttributeFilter()
      Return the predicate to use to include Bean Definition attributes.
      Returns:
      the bean definition's attributes include filter
    • shouldDeclareCreator

      protected boolean shouldDeclareCreator(Executable instanceCreator)
      Specify if the creator Executable should be defined. By default, a creator is specified if the instanceSupplier callback is used with an instanceContext callback.
      Parameters:
      instanceCreator - the executable to use to instantiate the bean
      Returns:
      true to declare the creator
    • generateBeanInstance

      protected CodeContribution generateBeanInstance(RuntimeHints runtimeHints)
      Return the necessary code to instantiate and post-process a bean.
      Parameters:
      runtimeHints - the RuntimeHints to use
      Returns:
      a code contribution that provides an initialized bean instance
    • initializeBeanDefinitionRegistrar

      protected org.springframework.javapoet.CodeBlock initializeBeanDefinitionRegistrar()