@SpringBootConfiguration:SpringBoot的配置
@Configuration: spring配置类 @Component:说明这也是一个spring的组件
@EnableAutoConfiguration:自动配置
@AutoConfigurationPackage:自动配置包 @Import({Registrar.class}):导入了选择器 @Import({AutoConfigurationImportSelector.class}):自动配置选择器 List<String> configurations = this.getCandidateConfigurations(annotationMetadata, attributes); //获取所有的配置
protected List<String> getCandidateConfigurations(AnnotationMetadata metadata, AnnotationAttributes attributes) { List<String> configurations = SpringFactoriesLoader.loadFactoryNames(this.getSpringFactoriesLoaderFactoryClass(), this.getBeanClassLoader()); Assert.notEmpty(configurations, "No auto configuration classes found in META-INF/spring.factories. If you are using a custom packaging, make sure that file is correct."); return configurations; }
标签:spring,配置,Boot,选择器,Spring,List,日记,configurations From: https://www.cnblogs.com/bzsc/p/18044594