- @ComponentScans及@ComponentScan 配置扫描的包路径,以及指定扫描的时候包含哪些组件或者排除哪些组件(可以扩展被spring托管Bean的规则),规则如下: org.springframework.context.annotation.FilterType
- //FilterType.ANNOTATION:类是否有注解修饰
//FilterType.ASSIGNABLE_TYPE:按照给定的类型;
- //FilterType.ASPECTJ:使用ASPECTJ表达式
- //FilterType.REGEX:类名是否满足正则表达式
- //FilterType.CUSTOM:使用自定义规org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isCandidateComponent(MetadataReader),先判断excludeFilters,再判断includeFilters。
- @Bean
@Import
FactoryBean