Example usage for org.springframework.data.util AnnotatedTypeScanner AnnotatedTypeScanner

List of usage examples for org.springframework.data.util AnnotatedTypeScanner AnnotatedTypeScanner

Introduction

In this page you can find the example usage for org.springframework.data.util AnnotatedTypeScanner AnnotatedTypeScanner.

Prototype

@SafeVarargs
public AnnotatedTypeScanner(Class<? extends Annotation>... annotationTypes) 

Source Link

Document

Creates a new AnnotatedTypeScanner for the given annotation types.

Usage

From source file:org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.java

@SuppressWarnings("unchecked")
private Set<Class<?>> getProjections(Repositories repositories) {

    Set<String> packagesToScan = new HashSet<String>();

    for (Class<?> domainType : repositories) {
        packagesToScan.add(domainType.getPackage().getName());
    }//from  ww  w.java  2s .  c  om

    AnnotatedTypeScanner scanner = new AnnotatedTypeScanner(Projection.class);
    scanner.setEnvironment(applicationContext.getEnvironment());
    scanner.setResourceLoader(applicationContext);

    return scanner.findTypes(packagesToScan);
}