| java.lang.Object org.apache.cocoon.util.ClassUtils
ClassUtils | public class ClassUtils (Code) | | A collection of class management utility methods.
author: Ricardo Rocha author: Stefano Mazzocchi version: CVS $Id: ClassUtils.java 433543 2006-08-22 06:22:54Z crossley $ |
getClassLoader | public static ClassLoader getClassLoader()(Code) | | Return the context classloader.
BL: if this is command line operation, the classloading issues
are more sane. During servlet execution, we explicitly set
the ClassLoader.
The context classloader. |
getResource | public static URL getResource(String resource) throws MalformedURLException(Code) | | Return a resource URL.
BL: if this is command line operation, the classloading issues
are more sane. During servlet execution, we explicitly set
the ClassLoader.
The context classloader. exception: MalformedURLException - If a loading error occurs |
implementsInterface | public static boolean implementsInterface(String className, String iface) throws Exception(Code) | | Tests if a class implements a given interface
true if class implements given interface. |
implementsInterface | public static boolean implementsInterface(Class class1, Class iface)(Code) | | Tests if a class implements a given interface
true if class implements given interface. |
lastModified | public static long lastModified(Class aClass) throws IOException, IllegalArgumentException(Code) | | Determine the last modification date for this
class file or its enclosing library
Parameters: aClass - A class whose last modification date is queried The time the given class was last modified exception: IOException - IOError exception: IllegalArgumentException - The class was not loaded from a fileor directory |
loadClass | public static Class loadClass(String className) throws ClassNotFoundException(Code) | | Load a class given its name.
BL: We wan't to use a known ClassLoader--hopefully the hierarchy
is set correctly.
Parameters: className - A class name The class pointed to by className exception: ClassNotFoundException - If a loading error occurs |
newInstance | public static Object newInstance(String className) throws Exception(Code) | | Create a new instance given a class name
Parameters: className - A class name A new instance exception: Exception - If an instantiation error occurs |
which | public static String which(Class aClass)(Code) | | Gets the absolute pathname of the class file
containing the specified class name, as prescribed
by the current classpath.
Parameters: aClass - Name of the class. |
|
|