Here you can find the source of getMethodByName(Class> aClass, String methodName, Class>... params)
Parameter | Description |
---|---|
methodName | a parameter |
public static Method getMethodByName(Class<?> aClass, String methodName, Class<?>... params)
//package com.java2s; /*/* w ww.j a v a 2 s.c om*/ Leola Programming Language Author: Tony Sparks See license.txt */ import java.lang.reflect.Method; public class Main { /** * Retrieves a method by name (grabs the first if overloaded). * * @param methodName * @return the method if found, otherwise null */ public static Method getMethodByName(Class<?> aClass, String methodName, Class<?>... params) { Method result = null; try { result = aClass.getMethod(methodName, params); } catch (Exception e) { } return (result); } }