public class ClassTools extends Object
| Modifier and Type | Method and Description |
|---|---|
static List |
collectClasses(String classPath)
Create a list of all classes that are available from classPath.
|
static List |
collectClassNames(String classPath)
Create a list of class names in dot notation that can be found in the
classPath.
|
static <T> Class<T> |
createClass(String className,
Class<T> expectedClass,
ClassLoader classLoader) |
static ClassLoader |
createClassLoader(String classPath)
Create a new ClassLoader on the specified classpath
|
static String |
getPackageName(Class clazz) |
static String |
getPackageName(String name) |
static String |
getUnqualifiedName(Class clazz) |
static String |
getUnqualifiedName(String name) |
public static List collectClasses(String classPath) throws IOException
Be aware that the classes are loaded and so any static code is executed.
classPath - The classpath to inspectIOExceptionpublic static List collectClassNames(String classPath) throws IOException
classPath - The classpath to inspectIOExceptionpublic static <T> Class<T> createClass(String className, Class<T> expectedClass, ClassLoader classLoader) throws ObjectCreationException
ObjectCreationExceptionpublic static ClassLoader createClassLoader(String classPath)
classPath - The classpath we want to load from.Copyright © 2013 intarsys consulting GmbH. All Rights Reserved.