Here you can find the source of getMethodObject(Object object, String method, Object[] parametre)
public static Object getMethodObject(Object object, String method, Object[] parametre)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Method; public class Main { public static Object getMethodObject(Object object, String method, Object[] parametre) { Object str = null;/* ww w .j a v a2 s . c om*/ Class[] classes = null; if (parametre != null) { classes = new Class[parametre.length]; for (int i = 0; i < classes.length; i++) classes[i] = parametre[i].getClass(); } try { Method run = object.getClass().getMethod(method, classes); str = run.invoke(object, parametre); } catch (Exception e) { str = null; } return str; } }