public class ClassFinder extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static org.slf4j.Logger |
log |
| Constructor and Description |
|---|
ClassFinder() |
| Modifier and Type | Method and Description |
|---|---|
private static List<Class<?>> |
findClasses(File directory,
String packageName)
Recursive method used to find all classes in a given directory and
subdirs.
|
static List<Class<?>> |
findClasses(JarFile jar,
String packageName) |
static List<Class<?>> |
findClasses(JarFile jar,
String packageName,
ClassLoader loader) |
static Class<?>[] |
getClasses(String packageName) |
static Class<?>[] |
getClasses(String packageName,
ClassLoader loader)
Scans all classes accessible from the context class loader which belong
to the given package and subpackages.
|
public static Class<?>[] getClasses(String packageName) throws ClassNotFoundException, IOException
ClassNotFoundExceptionIOExceptionpublic static Class<?>[] getClasses(String packageName, ClassLoader loader) throws ClassNotFoundException, IOException
packageName - The base packageClassNotFoundExceptionIOExceptionpublic static List<Class<?>> findClasses(JarFile jar, String packageName) throws ClassNotFoundException
ClassNotFoundExceptionpublic static List<Class<?>> findClasses(JarFile jar, String packageName, ClassLoader loader) throws ClassNotFoundException
ClassNotFoundExceptionprivate static List<Class<?>> findClasses(File directory, String packageName) throws ClassNotFoundException
directory - The base directorypackageName - The package name for classes found inside the base directoryClassNotFoundExceptionCopyright © 2018. All rights reserved.