Here you can find the source of getMethod(Object o, String methodName)
public static Method getMethod(Object o, String methodName)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; public class Main { public static Method getMethod(Object o, String methodName) { if ((methodName == null) || (o == null)) { return null; }/*from w w w .j a v a 2 s.co m*/ Method[] ms = o.getClass().getMethods(); for (int i = 0; i < ms.length; i++) { Method m = ms[i]; if (m.getName().equals(methodName)) { return m; } } return null; } }