Package org.apache.hadoop.hbase
Class ClassFinder
java.lang.Object
org.apache.hadoop.hbase.ClassFinder
- Direct Known Subclasses:
ClassTestFinder
A class that finds a set of classes that are locally accessible (from .class or .jar files), and
satisfy the conditions that are imposed by name and class filters provided by the user.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
private static class
static interface
static class
static interface
-
Field Summary
Modifier and TypeFieldDescriptionprivate static String
private ClassFinder.ClassFilter
private ClassLoader
private FileFilter
private ClassFinder.FileNameFilter
private static final org.slf4j.Logger
private ClassFinder.ResourcePathFilter
-
Constructor Summary
ConstructorDescriptionClassFinder
(ClassLoader classLoader) ClassFinder
(ClassFinder.ResourcePathFilter resourcePathFilter, ClassFinder.FileNameFilter fileNameFilter, ClassFinder.ClassFilter classFilter) ClassFinder
(ClassFinder.ResourcePathFilter resourcePathFilter, ClassFinder.FileNameFilter fileNameFilter, ClassFinder.ClassFilter classFilter, ClassLoader classLoader) -
Method Summary
Modifier and TypeMethodDescriptionfindClasses
(boolean proceedOnExceptions) Finds the classes in current package (of ClassFinder) and nested packages.findClasses
(String packageName, boolean proceedOnExceptions) Finds the classes in a package and nested packages.findClassesFromFiles
(File baseDirectory, String packageName, boolean proceedOnExceptions) findClassesFromJar
(String jarFileName, String packageName, boolean proceedOnExceptions) private Class<?>
-
Field Details
-
LOG
-
CLASS_EXT
-
resourcePathFilter
-
fileNameFilter
-
classFilter
-
fileFilter
-
classLoader
-
-
Constructor Details
-
ClassFinder
-
ClassFinder
public ClassFinder(ClassFinder.ResourcePathFilter resourcePathFilter, ClassFinder.FileNameFilter fileNameFilter, ClassFinder.ClassFilter classFilter) -
ClassFinder
public ClassFinder(ClassFinder.ResourcePathFilter resourcePathFilter, ClassFinder.FileNameFilter fileNameFilter, ClassFinder.ClassFilter classFilter, ClassLoader classLoader)
-
-
Method Details
-
findClasses
public Set<Class<?>> findClasses(boolean proceedOnExceptions) throws ClassNotFoundException, IOException, LinkageError Finds the classes in current package (of ClassFinder) and nested packages.- Parameters:
proceedOnExceptions
- whether to ignore exceptions encountered for individual jars/files/classes, and proceed looking for others.- Throws:
ClassNotFoundException
IOException
LinkageError
-
findClasses
public Set<Class<?>> findClasses(String packageName, boolean proceedOnExceptions) throws ClassNotFoundException, IOException, LinkageError Finds the classes in a package and nested packages.- Parameters:
packageName
- package namesproceedOnExceptions
- whether to ignore exceptions encountered for individual jars/files/classes, and proceed looking for others.- Throws:
ClassNotFoundException
IOException
LinkageError
-
findClassesFromJar
private Set<Class<?>> findClassesFromJar(String jarFileName, String packageName, boolean proceedOnExceptions) throws IOException, ClassNotFoundException, LinkageError -
findClassesFromFiles
private Set<Class<?>> findClassesFromFiles(File baseDirectory, String packageName, boolean proceedOnExceptions) throws ClassNotFoundException, LinkageError - Throws:
ClassNotFoundException
LinkageError
-
makeClass
private Class<?> makeClass(String className, boolean proceedOnExceptions) throws ClassNotFoundException, LinkageError - Throws:
ClassNotFoundException
LinkageError
-