|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.util.ClassUtils
public class ClassUtils
A collection of class management utility methods.
Constructor Summary | |
---|---|
ClassUtils()
|
Method Summary | |
---|---|
static ClassLoader |
getClassLoader()
Return the context classloader. |
static URL |
getResource(String resource)
Return a resource URL. |
static boolean |
implementsInterface(Class class1,
Class iface)
Deprecated. Will be removed 2 versions after 2.1.5 |
static boolean |
implementsInterface(String className,
String iface)
Deprecated. Will be removed 2 versions after 2.1.5 |
static long |
lastModified(Class aClass)
Deprecated. Will be removed 2 versions after 2.1.5 |
static Class |
loadClass(String className)
Load a class given its name. |
static Object |
newInstance(String className)
Create a new instance given a class name |
static String |
which(Class aClass)
Deprecated. Will be removed 2 versions after 2.1.5 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassUtils()
Method Detail |
---|
public static Object newInstance(String className) throws Exception
className
- A class name
Exception
- If an instantiation error occurspublic static Class loadClass(String className) throws ClassNotFoundException
className
- A class name
className
ClassNotFoundException
- If a loading error occurspublic static URL getResource(String resource) throws MalformedURLException
MalformedURLException
- If a loading error occurspublic static ClassLoader getClassLoader()
public static boolean implementsInterface(String className, String iface) throws Exception
Exception
public static boolean implementsInterface(Class class1, Class iface)
public static long lastModified(Class aClass) throws IOException, IllegalArgumentException
aClass
- A class whose last modification date is queried
IOException
- IOError
IllegalArgumentException
- The class was not loaded from a file
or directorypublic static String which(Class aClass)
aClass
- Name of the class.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |