public class ClassLoaderUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
ClassLoaderUtils.DummySecurityManager |
Modifier and Type | Field and Description |
---|---|
private static ClassLoaderUtils.DummySecurityManager |
MANAGER |
Constructor and Description |
---|
ClassLoaderUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Class |
forName(java.lang.String name)
Loads a specified class.
|
static java.lang.Class[] |
getClassContext()
Returns the current execution stack as an array of classes.
|
static java.lang.Class |
getClassContextAt(int i)
Returns a class at specified depth of the current execution stack.
|
static java.lang.ClassLoader |
getClassLoaderContextAt(int i)
Returns a classloader at specified depth of the current execution stack.
|
static java.io.InputStream |
getResourceAsStream(java.lang.String name)
Gets an InputStream to a resource of a specified name.
|
static java.lang.Class<?> |
loadClass(java.lang.String className,
java.lang.Class<?> callingClass) |
private static java.lang.Class<?> |
loadClass2(java.lang.String className,
java.lang.Class<?> callingClass) |
private static ClassLoaderUtils.DummySecurityManager MANAGER
public static java.lang.Class[] getClassContext()
The length of the array is the number of methods on the execution stack.
The element at index 0
is the class of the currently
executing method, the element at index 1
is the class of
that method's caller, and so on.
public static java.lang.Class getClassContextAt(int i)
public static java.lang.ClassLoader getClassLoaderContextAt(int i)
public static java.io.InputStream getResourceAsStream(java.lang.String name)
public static java.lang.Class forName(java.lang.String name) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public static java.lang.Class<?> loadClass(java.lang.String className, java.lang.Class<?> callingClass) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
private static java.lang.Class<?> loadClass2(java.lang.String className, java.lang.Class<?> callingClass) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException