/** * Custom extension of {@link #addIncludeFilter(TypeFilter)} to extend the added {@link TypeFilter}. For the * {@link TypeFilter} handed we'll have two filters registered: one additionally enforcing the * {@link RepositoryDefinition} annotation, the other one forcing the extension of {@link Repository}. * * @see ClassPathScanningCandidateComponentProvider#addIncludeFilter(TypeFilter) */ @Override public void addIncludeFilter(TypeFilter includeFilter) { List<TypeFilter> filterPlusInterface = new ArrayList<TypeFilter>(2); filterPlusInterface.add(includeFilter); filterPlusInterface.add(new InterfaceTypeFilter(Repository.class)); super.addIncludeFilter(new AllTypeFilter(filterPlusInterface)); List<TypeFilter> filterPlusAnnotation = new ArrayList<TypeFilter>(2); filterPlusAnnotation.add(includeFilter); filterPlusAnnotation.add(new AnnotationTypeFilter(RepositoryDefinition.class, true, true)); super.addIncludeFilter(new AllTypeFilter(filterPlusAnnotation)); }
/** * Custom extension of {@link #addIncludeFilter(TypeFilter)} to extend the added {@link TypeFilter}. For the * {@link TypeFilter} handed we'll have two filters registered: one additionally enforcing the * {@link RepositoryDefinition} annotation, the other one forcing the extension of {@link Repository}. * * @see ClassPathScanningCandidateComponentProvider#addIncludeFilter(TypeFilter) */ @Override public void addIncludeFilter(TypeFilter includeFilter) { List<TypeFilter> filterPlusInterface = new ArrayList<>(2); filterPlusInterface.add(includeFilter); filterPlusInterface.add(new InterfaceTypeFilter(Repository.class)); super.addIncludeFilter(new AllTypeFilter(filterPlusInterface)); List<TypeFilter> filterPlusAnnotation = new ArrayList<>(2); filterPlusAnnotation.add(includeFilter); filterPlusAnnotation.add(new AnnotationTypeFilter(RepositoryDefinition.class, true, true)); super.addIncludeFilter(new AllTypeFilter(filterPlusAnnotation)); }