Here you can find the source of invoke(Object context, String methodName, Object parameter)
public static void invoke(Object context, String methodName, Object parameter)
//package com.java2s; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class Main { public static void invoke(Object context, String methodName, Object parameter) { try {/*from ww w . j a va 2s . c om*/ Class methodHodler = context.getClass(); Method method = methodHodler.getMethod(methodName, parameter.getClass()); method.invoke(context, parameter); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } }