use of org.springframework.data.repository.RepositoryDefinition in project spring-data-commons by spring-projects.
the class RepositoryComponentProvider method addIncludeFilter.
/**
* 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));
}
Aggregations