|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gemini.blueprint.util.internal.ReflectionUtils
public abstract class ReflectionUtils
Reflection related utility class. Similar to that found inside main Spring distribution but with customizations particular to this framework.
ReflectionUtils
Nested Class Summary | |
---|---|
static class |
ReflectionUtils.InvocationCheckedExceptionWrapper
Runtime exception wrapper for checked exceptions thrown by invoked methods. |
Constructor Summary | |
---|---|
ReflectionUtils()
|
Method Summary | |
---|---|
static Exception |
getInvocationException(Exception exception)
Analyze the given exception and, if it's of type ReflectionUtils.InvocationCheckedExceptionWrapper then will return the actual
cause, otherwise return the original exception given. |
static void |
handleInvocationTargetException(InvocationTargetException ex)
Handle the given invocation target exception. |
static Object |
invokeMethod(Method method,
Object target)
Invoke the specified Method against the supplied target object
with no arguments. |
static Object |
invokeMethod(Method method,
Object target,
Object[] args)
Invoke the specified Method against the supplied target object
with the supplied arguments. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReflectionUtils()
Method Detail |
---|
public static Object invokeMethod(Method method, Object target)
Method
against the supplied target object
with no arguments. The target object can be null
when
invoking a static Method
.
This method is identical to
ReflectionUtils.invokeMethod(Method, Object)
except that if the target method throws a checked exception, the method
will throw a InvocationCheckedException.
Thrown exceptions are handled via a call to
#handleReflectionException
.
method
- the method to invoketarget
- the target object to invoke the method on
invokeMethod(java.lang.reflect.Method, Object, Object[])
public static Object invokeMethod(Method method, Object target, Object[] args)
Method
against the supplied target object
with the supplied arguments. The target object can be null
when invoking a static Method
.
This method is identical to
ReflectionUtils.invokeMethod(Method, Object)
except that if the target method throws a checked exception, the method
will throw a InvocationCheckedException.
Thrown exceptions are handled via a call to
#handleReflectionException
.
method
- the method to invoketarget
- the target object to invoke the method onargs
- the invocation arguments (may be null
)
invokeMethod(java.lang.reflect.Method, Object, Object[])
public static void handleInvocationTargetException(InvocationTargetException ex)
Throws the underlying RuntimeException or Error in case of such a root
cause. Throws an InvocationCheckedException else (the main difference
from
ReflectionUtils.handleInvocationTargetException(InvocationTargetException)
.
ex
- the invocation target exception to handlepublic static Exception getInvocationException(Exception exception)
ReflectionUtils.InvocationCheckedExceptionWrapper
then will return the actual
cause, otherwise return the original exception given.
exception
- invocation exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |