Java Reflection Generic Type from Class getGenericTypes(Class c)

Here you can find the source of getGenericTypes(Class c)

Description

get Generic Types

License

Apache License

Declaration

public static final Type[] getGenericTypes(Class<?> c) 

Method Source Code

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

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class Main {

    public static final Type[] getGenericTypes(Class<?> c) {
        Type superClass = c.getGenericSuperclass();
        ParameterizedType type = (ParameterizedType) superClass;
        return type.getActualTypeArguments();
    }/* w ww.  j av  a  2s  . c  o m*/
}

Related

  1. getGenericTypeClasses(List> genericTypeClasses, Type... genericTypes)
  2. getGenericTypeForMapProperty(Class javaClass, String propertyName, boolean isKeyType)
  3. getGenericTypeOfInterface(Class clazz, Class specificInterface)
  4. getGenericTypeOfParameter(Class clazz, String method, int parameterIndex)
  5. getGenericTypeParameter(Class aClass, Class genericClass, int index)
  6. getGenericTypes(Class clazz)
  7. getGenericTypes(final Class iClass)
  8. getGenericTypesImpl(ParameterizedType ptype, List> classes)