org.hippoecm.hst.component.support.spring.util
Class MetadataReaderClasspathResourceScanner

java.lang.Object
  extended by org.hippoecm.hst.component.support.spring.util.MetadataReaderClasspathResourceScanner
All Implemented Interfaces:
ClasspathResourceScanner, org.springframework.context.ResourceLoaderAware

public class MetadataReaderClasspathResourceScanner
extends Object
implements ClasspathResourceScanner, org.springframework.context.ResourceLoaderAware

MetadataReaderClasspathResourceScanner

This class implements ClasspathResourceScanner by leveraging Spring Framework components.

This class can be used in either way, defining a bean in the application context or invoking the static newInstance(ServletContext) method. The former is convenient for the applications which already use Spring Framework, while the latter is convenient for the applications which don't use Spring Framework.

Version:
$Id$

Constructor Summary
MetadataReaderClasspathResourceScanner()
           
 
Method Summary
static MetadataReaderClasspathResourceScanner newInstance(javax.servlet.ServletContext servletContext)
          Create an instance with setting the proper ResourceLoader object.
 Set<String> scanClassNamesAnnotatedBy(Class<? extends Annotation> annotationType, boolean matchSuperClass, String... locationPatterns)
          Scans classpath from the location specified by locationPatterns for all class names which annotates the speified annotationType.
 void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataReaderClasspathResourceScanner

public MetadataReaderClasspathResourceScanner()
Method Detail

newInstance

public static MetadataReaderClasspathResourceScanner newInstance(javax.servlet.ServletContext servletContext)
Create an instance with setting the proper ResourceLoader object. If there's any web application context already, then the existing web application context is used as ResourceLoader. Otherwise, it creates a ResourceLoader internally for convenience.

Parameters:
servletContext -
Returns:

scanClassNamesAnnotatedBy

public Set<String> scanClassNamesAnnotatedBy(Class<? extends Annotation> annotationType,
                                             boolean matchSuperClass,
                                             String... locationPatterns)
Description copied from interface: ClasspathResourceScanner
Scans classpath from the location specified by locationPatterns for all class names which annotates the speified annotationType.

Note: An implementation is recommended to support locationPattern with classpath*: prefix at least like the following example:

Specified by:
scanClassNamesAnnotatedBy in interface ClasspathResourceScanner
Returns:

setResourceLoader

public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
Specified by:
setResourceLoader in interface org.springframework.context.ResourceLoaderAware


Copyright © 2008-2012 Hippo. All Rights Reserved.