springboot 扫描类
ClassPathScanningCandidateComponentProvider
// 关闭默认过滤器
ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
// 添加自定义过滤器(包含),排除使用addExcludeFilter
provider.addIncludeFilter(new AnnotationTypeFilter(Entity.class));
// 扫描指定classpath或者包路径下的bean定义
Set<BeanDefinition> beanDefinitions = provider.findCandidateComponents(basePackage)
常用的过滤器
AnnotationTypeFilter 注解类
AssignableTypeFilter 被继承的类