com.googlecode.flyway.core.util.scanner
Class ClassPathScanner

java.lang.Object
  extended by com.googlecode.flyway.core.util.scanner.ClassPathScanner

public class ClassPathScanner
extends java.lang.Object

ClassPath scanner.


Constructor Summary
ClassPathScanner()
           
 
Method Summary
 java.lang.Class<?>[] scanForClasses(java.lang.String location, java.lang.Class<?>... implementedInterfaces)
          Scans the classpath for classes under the specified package implementing any of these interfaces.
 ClassPathResource[] scanForResources(java.lang.String location, java.lang.String prefix, java.lang.String suffix)
          Scans the classpath for resources under the specified location, starting with the specified prefix and ending with the specified suffix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPathScanner

public ClassPathScanner()
Method Detail

scanForResources

public ClassPathResource[] scanForResources(java.lang.String location,
                                            java.lang.String prefix,
                                            java.lang.String suffix)
                                     throws java.io.IOException
Scans the classpath for resources under the specified location, starting with the specified prefix and ending with the specified suffix.

Parameters:
location - The location (directory) in the classpath to start searching. Subdirectories are also searched.
prefix - The prefix of the resource names to match.
suffix - The suffix of the resource names to match.
Returns:
The resources that were found.
Throws:
java.io.IOException - when the location could not be scanned.

scanForClasses

public java.lang.Class<?>[] scanForClasses(java.lang.String location,
                                           java.lang.Class<?>... implementedInterfaces)
                                    throws java.lang.Exception
Scans the classpath for classes under the specified package implementing any of these interfaces.

Parameters:
location - The location (package) in the classpath to start scanning. Subpackages are also scanned.
implementedInterfaces - The interfaces the matching classes should implement..
Returns:
The classes that were found.
Throws:
java.lang.Exception - when the location could not be scanned.


Copyright © 2012. All Rights Reserved.