Java Reflection Method Parameter getMethod(Class clazz, String name, Class... parameterTypes)

Here you can find the source of getMethod(Class clazz, String name, Class... parameterTypes)

Description

Util method to get a method, ignoring checked exceptions

License

Open Source License

Parameter

Parameter Description
clazz a parameter
name a parameter
parameterTypes a parameter

Return

method

Declaration

private static Method getMethod(Class clazz, String name, Class... parameterTypes) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.lang.reflect.Method;

public class Main {
    /**//from  w  ww .j a v  a  2s .c  o  m
     * Util method to get a method, ignoring checked exceptions
     *
     * @param clazz
     * @param name
     * @param parameterTypes
     * @return method
     */
    private static Method getMethod(Class clazz, String name, Class... parameterTypes) {
        Method method = null;
        try {
            method = clazz.getMethod(name, parameterTypes);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return method;
    }
}

Related

  1. getMethod(Class aClass, String methodName, Class[] parameterTypesToCheck, Class stopClass)
  2. getMethod(Class aClass, String name, Class... parameters)
  3. getMethod(Class cl, String methodName, String obfName, Class... parameterTypes)
  4. getMethod(Class clazz, String methodName, Class... parameterTypes)
  5. getMethod(Class clazz, String methodName, Class... parameterTypes)
  6. getMethod(Class clazz, String name, Class[] parameters)
  7. getMethod(Class declaringClass, String name, Class... parameterTypes)
  8. getMethod(Class klass, String methodName, Class[] parameterTypes)
  9. getMethod(Class target, String methodName, Class[] parameterTypes)