Spring-Import
Spring Import Author: HuiFer 源码阅读仓库: SourceHot-spring 分析 org.springframework.context.annotation.Import 1 2 3 4 5 6 7 8 9 10 11 12 13 @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Import { /** * {@link Configuration @Configuration}, {@link ImportSelector}, * {@link ImportBeanDefinitionRegistrar}, or regular component classes to import. * * 需要导入的类 */ Class<?>[] value(); } ImportBeanDefinitionRegistrar 注册 Import Bean org.springframework.context.annotation.ImportBeanDefinitionRegistrar 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 public interface ImportBeanDefinitionRegistrar { /** * Register bean definitions as necessary based on the given annotation metadata of * the importing {@code @Configuration} class. * <p>Note that {@link BeanDefinitionRegistryPostProcessor} types may <em>not</em> be * registered here, due to lifecycle constraints related to {@code @Configuration} * class processing. * * 对impor……