Here you can find the source of getGeneric(ParameterizedType type)
@SuppressWarnings("rawtypes") public static Class[] getGeneric(ParameterizedType type)
//package com.java2s; //License from project: LGPL import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; public class Main { @SuppressWarnings("rawtypes") public static Class[] getGeneric(ParameterizedType type) { try {/* w w w.j a v a 2s . c o m*/ if (type != null) { Type[] typeArgs = type.getActualTypeArguments(); if (typeArgs != null && typeArgs.length > 0) { Class[] args = new Class[typeArgs.length]; for (int i = 0; i < typeArgs.length; i++) { Type arg = typeArgs[i]; args[i] = (Class) arg; } return args; } } } catch (Exception e) { } return null; } }