public static < R , T > R invokeMethod ( T instance , Method method , Object ... arguments ) { try { return ( R ) method . invoke ( instance , arguments ) ; } catch ( IllegalAccessException e ) { throw new InvocationException ( "Illegal access invoking method [" + method + "]: " + e . getMessage ( ) , e ) ; } catch ( InvocationTargetException e ) { throw new InvocationException ( "Exception occurred invoking method [" + method + "]: " + e . getMessage ( ) , e ) ; } }
Invokes a method .