public class ClassLoaderUtils extends Object
Constructor and Description |
---|
ClassLoaderUtils() |
Modifier and Type | Method and Description |
---|---|
static Class |
forName(String name)
Loads a specified class.
|
static Class[] |
getClassContext()
Returns the current execution stack as an array of classes.
|
static Class |
getClassContextAt(int i)
Returns a class at specified depth of the current execution stack.
|
static ClassLoader |
getClassLoaderContextAt(int i)
Returns a classloader at specified depth of the current execution stack.
|
static InputStream |
getResourceAsStream(String name)
Gets an InputStream to a resource of a specified name.
|
static Class<?> |
loadClass(String className,
Class<?> callingClass) |
public static 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 Class getClassContextAt(int i)
public static ClassLoader getClassLoaderContextAt(int i)
public static InputStream getResourceAsStream(String name)
public static Class forName(String name) throws ClassNotFoundException
ClassNotFoundException
public static Class<?> loadClass(String className, Class<?> callingClass) throws ClassNotFoundException
ClassNotFoundException
Copyright © 2016. All rights reserved.