|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.velocity.util.ClassUtils
public class ClassUtils
Simple utility functions for manipulating classes and resources from the classloader.
Method Summary | |
---|---|
static java.lang.Class |
getClass(java.lang.String clazz)
Return the specified class. |
static java.lang.Object |
getNewInstance(java.lang.String clazz)
Return a new instance of the given class. |
static java.io.InputStream |
getResourceAsStream(java.lang.Class claz,
java.lang.String name)
Finds a resource with the given name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.Class getClass(java.lang.String clazz) throws java.lang.ClassNotFoundException
Class.forName( claz )
(which only calls the System class
loader) when the class might be in a different classloader (e.g. in a
webapp).
clazz
- the name of the class to instantiate
java.lang.ClassNotFoundException
public static java.lang.Object getNewInstance(java.lang.String clazz) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException
Class.forName( claz ).newInstance()
(which only
calls the System class loader) when the class might be in a different
classloader (e.g. in a webapp).
clazz
- the name of the class to instantiate
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
public static java.io.InputStream getResourceAsStream(java.lang.Class claz, java.lang.String name)
Class.getResourceAsString
when the resource
might come from a different classloader. (e.g. a webapp).
claz
- Class to use when getting the System classloader (used if no Thread
Context classloader available or fails to get resource).name
- name of the resource
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |