Here you can find the source of getMethodType(Class> clazz, String methodName)
public static Type getMethodType(Class<?> clazz, String methodName)
//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; } } }