Here you can find the source of getMethod(Object o, String methodName, Class[] paramTypes)
Parameter | Description |
---|---|
o | a parameter |
methodName | a parameter |
paramTypes | a parameter |
Parameter | Description |
---|---|
NoSuchMethodException | an exception |
public static Method getMethod(Object o, String methodName, Class[] paramTypes) throws NoSuchMethodException
//package com.java2s; import java.lang.reflect.Method; public class Main { /**//from ww w . j a v a 2 s .c om * * * @param o * @param methodName * @param paramTypes * @return * @throws NoSuchMethodException */ public static Method getMethod(Object o, String methodName, Class[] paramTypes) throws NoSuchMethodException { Class clz = o.getClass(); return clz.getMethod(methodName, paramTypes); } /** * * * @param clz * @param methodName * @param paramTypes * @return * @throws NoSuchMethodException */ public static Method getMethod(Class clz, String methodName, Class[] paramTypes) throws NoSuchMethodException { return clz.getMethod(methodName, paramTypes); } }