public class ClassLoaderUtils
extends java.lang.Object
Constructor and Description |
---|
ClassLoaderUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Class |
loadClass(java.lang.String theClassName,
java.lang.Class theReferrer)
Try loading a class first by using the context class loader or by using
the classloader of the referrer class if the context classloader failed
to load the class.
|
static java.lang.Class |
loadClassFromContextClassLoader(java.lang.String theClassName)
Try loading class using the Context class loader.
|
static java.lang.Class |
loadClassFromWebappClassLoader(java.lang.String theClassName,
java.lang.Class theReferrer)
Try loading class using the Webapp class loader.
|
static java.util.ResourceBundle |
loadPropertyResourceBundle(java.lang.String theName,
java.lang.Class theReferrer)
Try loading a resource bundle from either the context class loader or
the
|
public static java.lang.Class loadClass(java.lang.String theClassName, java.lang.Class theReferrer) throws java.lang.ClassNotFoundException
theClassName
- the name of the test classtheReferrer
- the class will be loaded using the classloader which
has loaded this referrer classjava.lang.ClassNotFoundException
- if the class cannot be loaded through
either classloaderpublic static java.lang.Class loadClassFromContextClassLoader(java.lang.String theClassName) throws java.lang.ClassNotFoundException
theClassName
- the class to loadClass
object for the class to loadjava.lang.ClassNotFoundException
- if the class cannot be loaded through
this class loaderpublic static java.lang.Class loadClassFromWebappClassLoader(java.lang.String theClassName, java.lang.Class theReferrer) throws java.lang.ClassNotFoundException
theClassName
- the class to loadtheReferrer
- the class will be loaded using the classloader which
has loaded this referrer classClass
object for the class to loadjava.lang.ClassNotFoundException
- if the class cannot be loaded through
this class loaderpublic static java.util.ResourceBundle loadPropertyResourceBundle(java.lang.String theName, java.lang.Class theReferrer)
theName
- the resource bundle nametheReferrer
- the resource bundle will be loaded using the
classloader which has loaded this referrer classCopyright © 2000-2004 Apache Software Foundation. All Rights Reserved.