Class BeanRegistryAdapter

java.lang.Object
org.springframework.beans.factory.support.BeanRegistryAdapter
All Implemented Interfaces:
BeanRegistry

public class BeanRegistryAdapter extends Object implements BeanRegistry
BeanRegistry implementation that delegates to BeanDefinitionRegistry and ListableBeanFactory.
Since:
7.0
Author:
Sebastien Deleuze
  • Constructor Details

  • Method Details

    • registerAlias

      public void registerAlias(String name, String alias)
      Description copied from interface: BeanRegistry
      Given a name, register an alias for it.
      Specified by:
      registerAlias in interface BeanRegistry
      Parameters:
      name - the canonical name
      alias - the alias to be registered
    • registerBean

      public <T> String registerBean(Class<T> beanClass)
      Description copied from interface: BeanRegistry
      Register a bean from the given bean class, which will be instantiated using the related resolvable constructor if any.
      Specified by:
      registerBean in interface BeanRegistry
      Parameters:
      beanClass - the class of the bean
      Returns:
      the generated bean name
    • registerBean

      public <T> String registerBean(Class<T> beanClass, Consumer<BeanRegistry.Spec<T>> customizer)
      Description copied from interface: BeanRegistry
      Register a bean from the given bean class, customizing it with the customizer callback. The bean will be instantiated using the supplier that can be configured in the customizer callback, or will be tentatively instantiated with its resolvable constructor otherwise.
      Specified by:
      registerBean in interface BeanRegistry
      Parameters:
      beanClass - the class of the bean
      customizer - callback to customize other bean properties than the name
      Returns:
      the generated bean name
    • registerBean

      public <T> void registerBean(String name, Class<T> beanClass)
      Description copied from interface: BeanRegistry
      Register a bean from the given bean class, which will be instantiated using the related resolvable constructor if any.
      Specified by:
      registerBean in interface BeanRegistry
      Parameters:
      name - the name of the bean
      beanClass - the class of the bean
    • registerBean

      public <T> void registerBean(String name, Class<T> beanClass, Consumer<BeanRegistry.Spec<T>> spec)
      Description copied from interface: BeanRegistry
      Register a bean from the given bean class, customizing it with the customizer callback. The bean will be instantiated using the supplier that can be configured in the customizer callback, or will be tentatively instantiated with its resolvable constructor otherwise.
      Specified by:
      registerBean in interface BeanRegistry
      Parameters:
      name - the name of the bean
      beanClass - the class of the bean
      spec - callback to customize other bean properties than the name
    • register

      public void register(BeanRegistrar registrar)
      Description copied from interface: BeanRegistry
      Register beans using the given BeanRegistrar.
      Specified by:
      register in interface BeanRegistry
      Parameters:
      registrar - the bean registrar that will be called to register additional beans