intarsys runtime library

de.intarsys.tools.reflect
Class ClassTools

java.lang.Object
  extended by de.intarsys.tools.reflect.ClassTools

public class ClassTools
extends Object

Tool class to enhance the reflective capabilities about classes.


Method Summary
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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

collectClasses

public static List collectClasses(String classPath)
                           throws IOException
Create a list of all classes that are available from classPath.

Be aware that the classes are loaded and so any static code is executed.

Parameters:
classPath - The classpath to inspect
Returns:
A list of all classes that are available from classPath.
Throws:
IOException

collectClassNames

public static List collectClassNames(String classPath)
                              throws IOException
Create a list of class names in dot notation that can be found in the classPath.

Parameters:
classPath - The classpath to inspect
Returns:
A list of class names in dot notation that can be found in the classPath.
Throws:
IOException

createClass

public static <T> Class<T> createClass(String className,
                                       Class<T> expectedClass,
                                       ClassLoader classLoader)
                            throws ObjectCreationException
Throws:
ObjectCreationException

createClassLoader

public static ClassLoader createClassLoader(String classPath)
Create a new ClassLoader on the specified classpath

Parameters:
classPath - The classpath we want to load from.
Returns:
A new ClassLoader on the specified classpath

intarsys runtime library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.