public class ClassScanner extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ClassScanner.FilterExpression
Function which will be invoked for deciding to include the class in final results.
|
Constructor and Description |
---|
ClassScanner() |
Modifier and Type | Method and Description |
---|---|
static Set<Class<?>> |
getAllClasses(String packageName)
Returns all classes within a package.
|
static Set<Class<?>> |
getAnnotatedClasses(Class<? extends Annotation>... annotations) |
static Set<Class<?>> |
getAnnotatedClasses(List<Class<? extends Annotation>> annotations)
Scans all classes accessible from the context class loader which belong to the current class loader.
|
static Set<Class<?>> |
getAnnotatedClasses(List<Class<? extends Annotation>> annotations,
ClassScanner.FilterExpression filter)
Scans all classes accessible from the context class loader which belong to the current class loader.
|
static Set<Class<?>> |
getAnnotatedClasses(Package toScan,
Class<? extends Annotation> annotation)
Scans all classes accessible from the context class loader which belong to the given package and subpackages.
|
static Set<Class<?>> |
getAnnotatedClasses(String packageName,
Class<? extends Annotation> annotation)
Scans all classes accessible from the context class loader which belong to the given package and subpackages.
|
public static Set<Class<?>> getAnnotatedClasses(Package toScan, Class<? extends Annotation> annotation)
toScan
- package to scanannotation
- Annotation to searchpublic static Set<Class<?>> getAnnotatedClasses(String packageName, Class<? extends Annotation> annotation)
packageName
- package name to scan.annotation
- Annotation to searchpublic static Set<Class<?>> getAnnotatedClasses(List<Class<? extends Annotation>> annotations, ClassScanner.FilterExpression filter)
annotations
- One or more annotation to search forfilter
- filter expression to include the final results in the output.public static Set<Class<?>> getAnnotatedClasses(List<Class<? extends Annotation>> annotations)
annotations
- One or more annotation to search for@SafeVarargs public static Set<Class<?>> getAnnotatedClasses(Class<? extends Annotation>... annotations)
Copyright © 2015–2021 Yahoo! Inc.. All rights reserved.