Here you can find the source of getMethod(Object obj, String methodName, Class paramClass)
private static Method getMethod(Object obj, String methodName, Class paramClass) throws NoSuchMethodException
//package com.java2s; /*/*from w w w. ja va 2 s .com*/ * Copyright 2001-2008 Aqris Software AS. All rights reserved. * * This program is dual-licensed under both the Common Development * and Distribution License ("CDDL") and the GNU General Public * License ("GPL"). You may elect to use one or the other of these * licenses. */ import java.lang.reflect.Method; public class Main { private static Method getMethod(Object obj, String methodName, Class paramClass) throws NoSuchMethodException { return getMethod(obj, methodName, new Class[] { paramClass }); } private static Method getMethod(final Object obj, final String methodName, Class[] paramClasses) throws NoSuchMethodException { Class aClass = obj instanceof Class ? (Class) obj : obj.getClass(); return aClass.getMethod(methodName, paramClasses); } }