Java Reflection Method Get from Object getMethodIgnoreCaseWithNoParams(Object o, String p)

Here you can find the source of getMethodIgnoreCaseWithNoParams(Object o, String p)

Description

get Method Ignore Case With No Params

License

Apache License

Declaration

public static Method getMethodIgnoreCaseWithNoParams(Object o, String p) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.lang.reflect.Method;

public class Main {

    public static Method getMethodIgnoreCaseWithNoParams(Object o, String p) {
        Class cls = o.getClass();
        Method[] methods = cls.getMethods();
        int point = 0;
        Method r = null;/*from   w  w  w. j a va  2s.  c o m*/
        for (int i = 0; i < methods.length; i++) {
            Method m = methods[i];
            if (m.getName().equalsIgnoreCase(p) && m.getParameterTypes().length == 0) {
                return m;
            }
        }
        return null;
    }
}

Related

  1. getMethodByName(Object target, String methodName)
  2. getMethodConfigByAnnotaton(Object instance, Class declaringClass, Class annotationType, Class type)
  3. getMethodDescriptor(Object instance, String methodName, Class aClass, Class... parameters)
  4. getMethodFirstParamType(final String methodName, final Object o)
  5. getMethodIfAny(final Object instance, final String name, final Class[] params)
  6. getMethodInHolder(String methodName, Object holder)
  7. getMethodInstace(Class c, Object inst, String name, Class[] types, boolean access)
  8. getMethodName(AccessibleObject method)
  9. getMethodNamed(String methodName, Object holder)