Here you can find the source of getMethod(final Class> clazz, final String name, final Class>... parameterTypes)
Parameter | Description |
---|---|
clazz | The represented class |
name | The name of method |
parameterTypes | The parameter types of method |
public static Method getMethod(final Class<?> clazz, final String name, final Class<?>... parameterTypes)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; public class Main { /**/*from w w w. jav a2 s . c o m*/ * Returns the matched public method of the specified class or null if no * such method * * @param clazz * The represented class * @param name * The name of method * @param parameterTypes * The parameter types of method * @return the matched method or null if not found */ public static Method getMethod(final Class<?> clazz, final String name, final Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (final Exception e) { return null; } } }