开门见山直接放代码
Field field;
clazzField = field.getType();
if (clazzField == Map.class) {
parameterizedType = (ParameterizedType)field.getGenericType();
Class key = (Class) parameterizedType.getActualTypeArguments()[0];
Class value = (Class) parameterizedType.getActualTypeArguments()[1];
}else if (clazzField == List.class) {
parameterizedType = (ParameterizedType)field.getGenericType();
Class clazz = (Class) parameterizedType.getActualTypeArguments()[0];
} else if (clazzField == Set.class) {
parameterizedType = (ParameterizedType) field.getGenericType();
Class clazz = (Class) parameterizedType.getActualTypeArguments()[0];
}