Java Reflection Method Name getMethod(Class c, String name)

Here you can find the source of getMethod(Class c, String name)

Description

get Method

License

Apache License

Declaration

public static java.lang.reflect.Method getMethod(Class<?> c, String name) 

Method Source Code


//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.lang.reflect.Method;

public class Main {
    public static java.lang.reflect.Method getMethod(Class<?> c, String name) {
        Method _method = null;//from ww w. ja va2s .  co m
        for (Method m : c.getMethods()) {
            if (m.getName().equalsIgnoreCase(name)) {
                _method = m;
                break;
            }
        }
        return _method;
    }
}

Related

  1. getMethod(Class targetClass, String name, Class paramClass)
  2. getMethod(Class targetClass, String targetMethodName)
  3. getMethod(Class theClass, String propertyName)
  4. getMethod(Class type, String name, Class[] paramTypes)
  5. getMethod(Class beanClass, String methodName, Class[] types)
  6. getMethod(Class c, String name)
  7. getMethod(Class c, String name, Class[] args)
  8. getMethod(Class clazz, String methodName)
  9. getMethod(Class clazz, String methodName, Class fieldType)