|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.defne.utility.reflection.ReflectionUtils
public final class ReflectionUtils
Reflection related utility class.
| Field Summary | |
|---|---|
static Class<?>[] |
EMPTY
Empty class array |
| Method Summary | ||
|---|---|---|
static Object |
callConstructor(Constructor<?> constructor,
Object[] arguments)
|
|
static Class<?> |
getClassFromName(String className)
Load class with the given name and returns it. |
|
static
|
getConstructor(Class<T> clazz,
List<Class<?>> arguments)
Gets class constructor with the given parameters.. |
|
static
|
getNewObject(Class<T> clazz)
Gets class instance. |
|
static ClassLoader |
getSystemClassLoader()
Gets system class loader. |
|
static ClassLoader |
getThreadClassLoader()
Gets current thread classloader. |
|
static Object |
invokeMethod(Object instance,
Method method,
Object[] arguments)
Calls the given object's method with supplied arguments. |
|
static void |
main(String[] args)
|
|
static void |
throwDefneExceptionFromPrivilege(PrivilegedActionException e)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Class<?>[] EMPTY
| Method Detail |
|---|
public static ClassLoader getThreadClassLoader()
This class loader works that is explained in the Java EE specifications.
public static <T> Object getNewObject(Class<T> clazz)
T - class typeclazz - class of the object
public static <T> Constructor<T> getConstructor(Class<T> clazz,
List<Class<?>> arguments)
T - class typeclazz - class of the objectarguments - contructor arguments
public static ClassLoader getSystemClassLoader()
public static Object invokeMethod(Object instance,
Method method,
Object[] arguments)
instance - object instancemethod - object methodarguments - method arguments
DefneException - if any runtime exception occurspublic static Class<?> getClassFromName(String className)
className - class name
public static Object callConstructor(Constructor<?> constructor,
Object[] arguments)
public static void throwDefneExceptionFromPrivilege(PrivilegedActionException e)
public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||