Class GenericsUtils

java.lang.Object
com.logicaldoc.webservice.doc.util.GenericsUtils

public class GenericsUtils extends Object
Get a variable's java type, or a collection's generic type
For Example,
"String a" => String.class, and "List<Integer> b" => Integer.class
  • Method Details

    • getFieldGenericType

      public static Class<?> getFieldGenericType(Field field)
    • getMethodGenericReturnType

      public static Class<?> getMethodGenericReturnType(Method method)
    • getMethodGenericParameterTypes

      public static Class<?> getMethodGenericParameterTypes(Method method, int paramIndex)
    • getMethodGenericParameterName

      public static String getMethodGenericParameterName(Method method, int paramIndex)