Here you can find the source of getGenericParametersInternal(Type genericFieldType)
private static Class<?>[] getGenericParametersInternal(Type genericFieldType)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; public class Main { private static Class<?>[] getGenericParametersInternal(Type genericFieldType) { if (genericFieldType instanceof ParameterizedType) { ParameterizedType aType = (ParameterizedType) genericFieldType; Type[] fieldArgTypes = aType.getActualTypeArguments(); Class<?>[] clazzes = new Class<?>[fieldArgTypes.length]; for (int i = 0; i < clazzes.length; i++) { clazzes[i] = (Class<?>) fieldArgTypes[i]; }// ww w . ja v a 2s .co m return clazzes; } return new Class<?>[] {}; } }