org.springframework.context.annotation

## 接口 ImportBeanDefinitionRegistrar

- 所有已知实现类:
    AutoProxyRegistrar

      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(org.springframework.core.type.AnnotationMetadata, org.springframework.beans.factory.support.BeanDefinitionRegistry)`:

  - `EnvironmentAware`
  - `BeanFactoryAware`
  - `BeanClassLoaderAware`
  - `ResourceLoaderAware`

  See implementations and associated unit tests for usage examples.

  从以下版本开始:
    3.1
  作者:
    Chris Beams
  另请参阅:
    `Import`, `ImportSelector`, `Configuration`

- - ### 方法概要

    所有方法 实例方法 抽象方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `registerBeanDefinitions(org.springframework.core.type.AnnotationMetadata importingClassMetadata, org.springframework.beans.factory.support.BeanDefinitionRegistry registry)` Register bean definitions as necessary based on the given annotation metadata of the importing `@Configuration` class.

- - ### 方法详细资料

    - #### registerBeanDefinitions

          void registerBeanDefinitions(org.springframework.core.type.AnnotationMetadata importingClassMetadata,
                                       org.springframework.beans.factory.support.BeanDefinitionRegistry registry)

      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.

      参数:
        `importingClassMetadata` - annotation metadata of the importing class
        `registry` - current bean definition registry