public class ClasspathScanner extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ALL_CLASS_FILES |
static String |
ALL_FILES |
static String |
CLASSPATH_URL_SCHEME |
static String |
WILDCARD |
Modifier | Constructor and Description |
---|---|
protected |
ClasspathScanner() |
Modifier and Type | Method and Description |
---|---|
static Map<Class<? extends Annotation>,Collection<Class<?>>> |
findClasses(Collection<String> basePackages,
Class<? extends Annotation>... annotations)
Scans list of base packages for all classes marked with specific annotations.
|
static Map<Class<? extends Annotation>,Collection<Class<?>>> |
findClasses(Collection<String> basePackages,
List<Class<? extends Annotation>> annotations)
Scans list of base packages for all classes marked with specific annotations.
|
static Map<Class<? extends Annotation>,Collection<Class<?>>> |
findClasses(Collection<String> basePackages,
List<Class<? extends Annotation>> annotations,
ClassLoader loader) |
static Map<Class<? extends Annotation>,Collection<Class<?>>> |
findClasses(String basePackage,
Class<? extends Annotation>... annotations)
Scans list of base packages for all classes marked with specific annotations.
|
protected Map<Class<? extends Annotation>,Collection<Class<?>>> |
findClassesInternal(Collection<String> basePackages,
List<Class<? extends Annotation>> annotations,
ClassLoader loader) |
static List<URL> |
findResources(Collection<String> basePackages,
String extension)
Scans list of base packages for all resources with the given extension.
|
static List<URL> |
findResources(Collection<String> basePackages,
String extension,
ClassLoader loader) |
static List<URL> |
findResources(String basePackage,
String extension)
Scans list of base packages for all resources with the given extension.
|
static List<URL> |
findResources(String basePackage,
String extension,
ClassLoader loader)
Scans list of base packages for all resources with the given extension.
|
protected List<URL> |
findResourcesInternal(Collection<String> basePackages,
String extension,
ClassLoader loader) |
static Set<String> |
parsePackages(String packagesAsCsv) |
public static final String ALL_FILES
public static final String ALL_CLASS_FILES
public static final String WILDCARD
public static final String CLASSPATH_URL_SCHEME
@SafeVarargs public static Map<Class<? extends Annotation>,Collection<Class<?>>> findClasses(String basePackage, Class<? extends Annotation>... annotations) throws IOException, ClassNotFoundException
basePackage
- base packageannotations
- annotations to discoverIOException
- class metadata is not readableClassNotFoundException
- class not found@SafeVarargs public static Map<Class<? extends Annotation>,Collection<Class<?>>> findClasses(Collection<String> basePackages, Class<? extends Annotation>... annotations) throws IOException, ClassNotFoundException
basePackages
- list of base packagesannotations
- annotations to discoverIOException
- class metadata is not readableClassNotFoundException
- class not foundpublic static Map<Class<? extends Annotation>,Collection<Class<?>>> findClasses(Collection<String> basePackages, List<Class<? extends Annotation>> annotations) throws IOException, ClassNotFoundException
basePackages
- list of base packagesannotations
- annotations to discoverIOException
- class metadata is not readableClassNotFoundException
- class not foundpublic static Map<Class<? extends Annotation>,Collection<Class<?>>> findClasses(Collection<String> basePackages, List<Class<? extends Annotation>> annotations, ClassLoader loader) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
protected Map<Class<? extends Annotation>,Collection<Class<?>>> findClassesInternal(Collection<String> basePackages, List<Class<? extends Annotation>> annotations, ClassLoader loader) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static List<URL> findResources(String basePackage, String extension) throws IOException
basePackage
- base packageextension
- the extension matching resources needs to haveIOException
- resource is not accessiblepublic static List<URL> findResources(String basePackage, String extension, ClassLoader loader) throws IOException
basePackage
- base packageextension
- the extension matching resources needs to haveIOException
- resource is not accessiblepublic static List<URL> findResources(Collection<String> basePackages, String extension) throws IOException
basePackages
- list of base packagesextension
- the extension matching resources needs to haveIOException
- resource is not accessiblepublic static List<URL> findResources(Collection<String> basePackages, String extension, ClassLoader loader) throws IOException
IOException
protected List<URL> findResourcesInternal(Collection<String> basePackages, String extension, ClassLoader loader) throws IOException
IOException
Copyright © 2016 JBoss by Red Hat. All rights reserved.