Java Reflection Method Parameter getMethodUp(Class type, String name, Class... parameterTypes)

Here you can find the source of getMethodUp(Class type, String name, Class... parameterTypes)

Description

get Method Up

Declaration

static public Method getMethodUp(Class<?> type, String name, Class<?>... parameterTypes) 

Method Source Code

//package com.java2s;

import java.lang.reflect.Method;

public class Main {
    static public Method getMethodUp(Class<?> type, String name, Class<?>... parameterTypes) {
        // super class
        Method method = null;/*from  ww w.java  2  s  .com*/
        for (Class<?> clazz = type; clazz != Object.class; clazz = clazz.getSuperclass()) {
            try {
                method = clazz.getDeclaredMethod(name, parameterTypes);
                break;
            } catch (Exception e) {
                // ignore
            }
        }
        return method;
    }
}

Related

  1. getMethodParametersType(Class clazz, String methodName)
  2. getMethodParameterTypes(final Method method)
  3. getMethodQuietly(Class clazz, String methodName, Class... parameterTypes)
  4. getMethodRecursive(final Class clazz, final String methodName, final Class... parameterTypes)
  5. getMethodsWith(Class c, Class... parameters)
  6. getMethodWithParameter(Class declaringClass, Class parameterClass)