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

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

Introduction

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

Prototype

public Set<Class<?>> findTypes(Iterable<String> basePackages) 

Source Link

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 .  j  a va 2  s  .  c  o  m*/

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

    return scanner.findTypes(packagesToScan);
}