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

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

Description

get Method

License

Mozilla Public License

Declaration

private static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) 

Method Source Code

//package com.java2s;
/*//from w  ww .  j a v a  2  s . c o  m
 * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
 * and the EPL 1.0 (http://h2database.com/html/license.html).
 * Initial Developer: H2 Group
 * Iso8601: Initial Developer: Philippe Marschall (firstName dot lastName
 * at gmail dot com)
 */

import java.lang.reflect.Method;

import java.util.Arrays;

public class Main {
    private static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) {
        try {
            return clazz.getMethod(methodName, parameterTypes);
        } catch (NoSuchMethodException e) {
            throw new IllegalStateException("Java 8 or later but method " + clazz.getName() + "#" + methodName + "("
                    + Arrays.toString(parameterTypes) + ") is missing", e);
        }
    }
}

Related

  1. getMethod(Class type, String name, Class[] parameterTypes)
  2. getMethod(Class c, String methodName, Class... parameterTypes)
  3. getMethod(Class clazz, String functionName, Class[] parameterTypes)
  4. getMethod(Class clazz, String method, Class... parameterTypes)
  5. getMethod(Class clazz, String methodName, Class... parameterTypes)
  6. getMethod(Class clazz, String methodName, Class... parameterTypes)
  7. getMethod(Class clazz, String name, Class... parameterTypes)
  8. getMethod(Class clazz, String name, Class... parameterTypes)
  9. getMethod(Class clazz, String name, Class[] parameterTypes)