Here you can find the source of invokeMethod(Method m, Object instance, Object[] args)
Parameter | Description |
---|---|
m | a parameter |
instance | a parameter |
args | a parameter |
public static Object invokeMethod(Method m, Object instance, Object[] args)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; public class Main { /**/*from w w w. j av a2 s. c o m*/ * * @param m * @param instance * @param args * @return */ public static Object invokeMethod(Method m, Object instance, Object[] args) { try { return m.invoke(instance, args); } catch (Throwable t) { throw new IllegalStateException(t); } } }