public class ClassFinder extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ClassFinder.And |
static interface |
ClassFinder.ClassFilter |
private static class |
ClassFinder.FileFilterWithName |
static interface |
ClassFinder.FileNameFilter |
static class |
ClassFinder.Not |
static interface |
ClassFinder.ResourcePathFilter |
Modifier and Type | Field and Description |
---|---|
private static String |
CLASS_EXT |
private ClassFinder.ClassFilter |
classFilter |
private FileFilter |
fileFilter |
private ClassFinder.FileNameFilter |
fileNameFilter |
private static org.slf4j.Logger |
LOG |
private ClassFinder.ResourcePathFilter |
resourcePathFilter |
Constructor and Description |
---|
ClassFinder() |
ClassFinder(ClassFinder.ResourcePathFilter resourcePathFilter,
ClassFinder.FileNameFilter fileNameFilter,
ClassFinder.ClassFilter classFilter) |
Modifier and Type | Method and Description |
---|---|
Set<Class<?>> |
findClasses(boolean proceedOnExceptions)
Finds the classes in current package (of ClassFinder) and nested packages.
|
Set<Class<?>> |
findClasses(String packageName,
boolean proceedOnExceptions)
Finds the classes in a package and nested packages.
|
private Set<Class<?>> |
findClassesFromFiles(File baseDirectory,
String packageName,
boolean proceedOnExceptions) |
private Set<Class<?>> |
findClassesFromJar(String jarFileName,
String packageName,
boolean proceedOnExceptions) |
private Class<?> |
makeClass(String className,
boolean proceedOnExceptions) |
private static final org.slf4j.Logger LOG
private ClassFinder.ResourcePathFilter resourcePathFilter
private ClassFinder.FileNameFilter fileNameFilter
private ClassFinder.ClassFilter classFilter
private FileFilter fileFilter
public ClassFinder()
public ClassFinder(ClassFinder.ResourcePathFilter resourcePathFilter, ClassFinder.FileNameFilter fileNameFilter, ClassFinder.ClassFilter classFilter)
public Set<Class<?>> findClasses(boolean proceedOnExceptions) throws ClassNotFoundException, IOException, LinkageError
proceedOnExceptions
- whether to ignore exceptions encountered for
individual jars/files/classes, and proceed looking for others.ClassNotFoundException
IOException
LinkageError
public Set<Class<?>> findClasses(String packageName, boolean proceedOnExceptions) throws ClassNotFoundException, IOException, LinkageError
packageName
- package namesproceedOnExceptions
- whether to ignore exceptions encountered for
individual jars/files/classes, and proceed looking for others.ClassNotFoundException
IOException
LinkageError
private Set<Class<?>> findClassesFromJar(String jarFileName, String packageName, boolean proceedOnExceptions) throws IOException, ClassNotFoundException, LinkageError
private Set<Class<?>> findClassesFromFiles(File baseDirectory, String packageName, boolean proceedOnExceptions) throws ClassNotFoundException, LinkageError
ClassNotFoundException
LinkageError
private Class<?> makeClass(String className, boolean proceedOnExceptions) throws ClassNotFoundException, LinkageError
ClassNotFoundException
LinkageError
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.