1 private Class<T> clz;
2 @SuppressWarnings("unchecked")
3 public Class<T> getClz() {
4 if (clz == null) {
5 // 获取泛型的Class对象
6 clz = ((Class<T>) (((ParameterizedType) (this.getClass()
7 .getGenericSuperclass())).getActualTypeArguments()[0]));
8 }
9 return clz;
10 }