Java Reflection Method Name getMethodType(Class clazz, String methodName)

Here you can find the source of getMethodType(Class clazz, String methodName)

Description

get Method Type

License

Apache License

Declaration

public static Type getMethodType(Class<?> clazz, String methodName) 

Method Source Code

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

import java.lang.reflect.Method;
import java.lang.reflect.Type;

public class Main {
    public static Type getMethodType(Class<?> clazz, String methodName) {
        try {//from  w w w. ja v a 2 s  .  c o m
            Method method = clazz.getMethod(methodName);

            return method.getGenericReturnType();
        } catch (Exception ex) {
            return null;
        }
    }
}

Related

  1. getMethods(final Class clazz, final String methodName)
  2. getMethods(String classname)
  3. getMethodsByName(Class cls, String methodName)
  4. getMethodSubjectName(Method method)
  5. getMethodsWithName(Class clazz, String name)
  6. getMethodUniqueName(Method method)