Java Reflection Method Name getMethod(Class clazz, String methodName, Class[] classes)

Here you can find the source of getMethod(Class clazz, String methodName, Class[] classes)

Description

get Method

License

Open Source License

Declaration

private static Method getMethod(Class clazz, String methodName,
            Class[] classes) 

Method Source Code

//package com.java2s;
/* $Id$/*from   w w w .  j  a v  a 2  s.  c  o  m*/
 *****************************************************************************
 * Copyright (c) 2009 Contributors - see below
 * 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:
 *    tfmorris
 *****************************************************************************
 *
 * Some portions of this file was previously release using the BSD License:
 */

import java.lang.reflect.Method;

public class Main {
    private static Method getMethod(Class clazz, String methodName,
            Class[] classes) {
        try {
            return clazz.getDeclaredMethod(methodName, classes);
        } catch (NoSuchMethodException e) {
            return null;
        }
    }
}

Related

  1. getMethod(Class c, String methodName)
  2. getMethod(Class c, String name)
  3. getMethod(Class cl, String methodName, Class[] paramTypes)
  4. getMethod(Class clazz, String methodName)
  5. getMethod(Class clazz, String methodName, Class argType)
  6. getMethod(Class clazz, String methodName, Class[] params)
  7. getMethod(Class clazz, String name)
  8. getMethod(Class clazz, String name, Class... args)
  9. getMethod(Class cls, String methodName, Class[] params)