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

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

Description

get Method

License

Open Source License

Declaration

public static Method getMethod(Class cl, String methodName, String obfName, Class... parameterTypes) 

Method Source Code

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

import java.lang.reflect.Method;

public class Main {
    public static Method getMethod(Class cl, String methodName, String obfName, Class... parameterTypes) {
        Method m = null;/*from  w ww.  j av a2s . c  o m*/
        try {
            try {
                m = cl.getDeclaredMethod(methodName, parameterTypes);
            } catch (Exception e) {
            }

            if (m == null)
                m = cl.getDeclaredMethod(obfName, parameterTypes);

            m.setAccessible(true);
            return m;
        } catch (Exception e) {
            return null;
        }
    }
}

Related

  1. getMethod(Class aClass, String methodName, Class[] parameterTypesToCheck, Class stopClass)
  2. getMethod(Class aClass, String name, Class... parameters)
  3. getMethod(Class clazz, String methodName, Class... parameterTypes)
  4. getMethod(Class clazz, String methodName, Class... parameterTypes)
  5. getMethod(Class clazz, String name, Class... parameterTypes)
  6. getMethod(Class clazz, String name, Class[] parameters)