|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.tools.reflect.ClassTools
public class ClassTools
Tool class to enhance the reflective capabilities about classes.
Method Summary | ||
---|---|---|
static java.util.List |
collectClasses(java.lang.String classPath)
Create a list of all classes that are available from classPath. |
|
static java.util.List |
collectClassNames(java.lang.String classPath)
Create a list of class names in dot notation that can be found in the classPath. |
|
static
|
createClass(java.lang.String className,
java.lang.Class<T> expectedClass,
java.lang.ClassLoader classLoader)
|
|
static java.lang.ClassLoader |
createClassLoader(java.lang.String classPath)
Create a new ClassLoader on the specified classpath |
|
protected static void |
extractClassNamesFromDir(java.util.List result,
java.io.File currentFile,
java.lang.String relativePath)
Create a list of all classes "current" and its subdirectories. |
|
protected static void |
extractClassNamesFromJar(java.util.List result,
java.io.File file)
Create a list of all ".class" entries in the jar file. |
|
static java.lang.String |
getPackageName(java.lang.Class clazz)
|
|
static java.lang.String |
getUnqualifiedName(java.lang.Class clazz)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.util.List collectClasses(java.lang.String classPath) throws java.io.IOException
Be aware that the classes are loaded and so any static code is executed.
classPath
- The classpath to inspect
java.io.IOException
public static java.util.List collectClassNames(java.lang.String classPath) throws java.io.IOException
classPath
- The classpath to inspect
java.io.IOException
public static <T> java.lang.Class<T> createClass(java.lang.String className, java.lang.Class<T> expectedClass, java.lang.ClassLoader classLoader) throws ObjectCreationException
ObjectCreationException
public static java.lang.ClassLoader createClassLoader(java.lang.String classPath)
classPath
- The classpath we want to load from.
protected static void extractClassNamesFromDir(java.util.List result, java.io.File currentFile, java.lang.String relativePath) throws java.io.IOException
result
- The collection that is filled with new classnamescurrentFile
- The directory/file under inspectionrelativePath
- The path extending from the initial root we are currently
inspecting.
java.io.IOException
protected static void extractClassNamesFromJar(java.util.List result, java.io.File file) throws java.io.IOException
result
- The collection that is filled with new classnamesfile
- The jar file we are inspecting.
java.io.IOException
public static java.lang.String getPackageName(java.lang.Class clazz)
public static java.lang.String getUnqualifiedName(java.lang.Class clazz)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |