接口 ImportBeanDefinitionRegistrar

所有已知子接口:
AnnotationBeanDefinitionRegistrar<A>
所有已知实现类:
AutoProxyRegistrar
函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@FunctionalInterface public interface ImportBeanDefinitionRegistrar
Interface to be implemented by types that register additional bean definitions when processing @Configuration classes. Useful when operating at the bean definition level (as opposed to @Bean method/instance level) is desired or necessary.

Along with @Configuration and ImportSelector, classes of this type may be provided to the @Import annotation (or may also be returned from an ImportSelector).

An ImportBeanDefinitionRegistrar may implement any of the following Aware interfaces, and their respective methods will be called prior to registerBeanDefinitions(cn.taketoday.core.type.AnnotationMetadata, cn.taketoday.context.loader.BootstrapContext):

Alternatively, the class may provide a single constructor with one or more of the following supported parameter types:

See implementations and associated unit tests for usage examples.

作者:
Chris Beams, Juergen Hoeller, TODAY 2019-10-01 19:08
另请参阅:
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    registerBeanDefinitions(cn.taketoday.core.type.AnnotationMetadata importMetadata, BootstrapContext context)
    Register bean definitions as necessary based on the given annotation metadata of the importing @Configuration class.
  • 方法详细资料

    • registerBeanDefinitions

      void registerBeanDefinitions(cn.taketoday.core.type.AnnotationMetadata importMetadata, BootstrapContext context)
      Register bean definitions as necessary based on the given annotation metadata of the importing @Configuration class.

      Note that BeanDefinitionRegistryPostProcessor types may not be registered here, due to lifecycle constraints related to @Configuration class processing.

      The default implementation is empty.

      参数:
      importMetadata - annotation metadata of the importing class
      context - Bean definition loading context