Sping Boot学习一、@SpringBootApplication

@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(
    excludeFilters = {@Filter(
    type = FilterType.CUSTOM,
    classes = {TypeExcludeFilter.class}
), @Filter(
    type = FilterType.CUSTOM,
    classes = {AutoConfigurationExcludeFilter.class}
)}
)

 

 

@SpringBootConfiguration :Spring Boot的配置类

 标注在某个类上表示这个是一个Spring Boot的配置类

              @Configuration:配置类---配置文件

@EnableAutoConfiguration:开启自动配置功能

 以前我们需要配置的东西通过该注解自动配置

@AutoConfigurationPackage
@Import({AutoConfigurationImportSelector.class})
public @interface EnableAutoConfiguration {

           @AutoConfigurationPackage自动配置包

                            @Import({Registrar.class}):Spring 底层注解@IMPORT,给容器中导入一个组件;导入的组件

          

 

你可能感兴趣的:(Java框架,JAVA)