Here you can find the source of invoke(Method method, Object object, Object... args)
Parameter | Description |
---|---|
method | the method |
object | the object |
args | the args |
Parameter | Description |
---|---|
Exception | the exception |
private static Object invoke(Method method, Object object, Object... args) throws Exception
//package com.java2s; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class Main { /**//from www . j av a 2s .co m * Invoke. * * @param method the method * @param object the object * @param args the args * @return the object * @throws Exception the exception */ private static Object invoke(Method method, Object object, Object... args) throws Exception { // NOPMD try { return method.invoke(object, args); } catch (final InvocationTargetException e) { if (e.getCause() instanceof Exception) { throw (Exception) e.getCause(); } else if (e.getCause() instanceof Error) { throw (Error) e.getCause(); } else { throw new Exception(e.getCause()); // NOPMD } } } }