@ComponentScan
该注解用于自动扫描包中的组件,定义了一些过滤器。
@ComponentScan(excludeFilters = {
@Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class),
@Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class) })
单看注解的源码没什么内容,注解还要通过运行时通过反射对注解的内容进行解析才能起到作用。
见博客。
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
@Repeatable(ComponentScans.class)
public @interface ComponentScan