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

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

Introduction

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

Prototype

@Override
    public void setResourceLoader(ResourceLoader resourceLoader) 

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

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

    return scanner.findTypes(packagesToScan);
}