Here you can find the source of getMethod(final Class> clazz, final String methodName, final Class>... parameterTypes)
public static Method getMethod(final Class<?> clazz, final String methodName, final Class<?>... parameterTypes)
//package com.java2s; /******************************************************************************* * Portions created by Sebastian Thomschke are copyright (c) 2005-2016 Sebastian * Thomschke./*from w w w .j av a2 s . com*/ * * All Rights Reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sebastian Thomschke - initial implementation. *******************************************************************************/ import java.lang.reflect.Method; public class Main { /** * @return the method or null if the method does not exist */ public static Method getMethod(final Class<?> clazz, final String methodName, final Class<?>... parameterTypes) { try { return clazz.getDeclaredMethod(methodName, parameterTypes); } catch (final NoSuchMethodException ex) { return null; } } }