public class ClassPathUtils extends Object
| Constructor and Description |
|---|
ClassPathUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Set<String> |
findClasses(String directory,
String packageName)
Recursive method used to find all classes in a given directory and
subdirs.
|
static Set<Class<?>> |
getAllInterfaces(Class<?> clazz)
Get all the interfaces for the class.
|
static void |
getAllInterfaces(Set<Class<?>> set,
Class<?> c)
Get all the interfaces that the class implements.
|
static Collection<Class<?>> |
getClasses(ClassLoader classLoader,
String packageName)
Find all classes accessible from the classloader which belong to the
given package and subpackages.
|
static Collection<Class<?>> |
getClasses(String packageName)
Find all classes accessible from the context class loader which belong to
the given package and subpackages.
|
static String[] |
getClassPathElements()
Get the array of class path elements.
|
public static Set<String> findClasses(String directory, String packageName) throws IOException
directory - The base directorypackageName - The package name for classes found inside the base directoryIOExceptionpublic static Collection<Class<?>> getClasses(String packageName)
packageName - The base package or class name.public static Collection<Class<?>> getClasses(ClassLoader classLoader, String packageName)
classLoader - The classloader to load the classes from.packageName - The base package or class namepublic static String[] getClassPathElements()
public static Set<Class<?>> getAllInterfaces(Class<?> clazz)
clazz - The class to find interfaces for.public static void getAllInterfaces(Set<Class<?>> set, Class<?> c)
set - The set off classes to add the interface classes to.c - The class to check.Copyright © 2013-2015 XENEI.com. All Rights Reserved.