ParameterizedType type = (ParameterizedType) this.getClass().getGenericSuperclass();
Class cls = (Class<T>) type.getActualTypeArguments()[0];
T t = (T) cls.newInstance(); //t 即为泛型实例化对象
转载于:https://my.oschina.net/eocms/blog/1933421
ParameterizedType type = (ParameterizedType) this.getClass().getGenericSuperclass();
Class cls = (Class<T>) type.getActualTypeArguments()[0];
T t = (T) cls.newInstance(); //t 即为泛型实例化对象
转载于:https://my.oschina.net/eocms/blog/1933421