java反射获取泛型类型 转换错误的问题

在用反射获取泛型类型中 遇到转换类型错误,错误提示是
java.lang.class cannot be cast to java.lang.reflect.ParameterizedType.
求大神解答 跪谢。。。。

我的 代码是

public class fanxingTestDaoImpl {

/**
 * 这个用来获取泛型获取实体类的名字
 */
private  Class classt;

public  fanxingTestDaoImpl(){


    ParameterizedType type = (ParameterizedType)this.getClass().getGenericSuperclass();
    //得到t的实现类型
    this.classt = (Class)type.getActualTypeArguments()[0];

    System.out.println("泛型得到的方法是"+classt.getSimpleName());

}   

}

你这个没写错,只是没写全,你只是告诉了它需要反射,但是在使用的时候你需要告诉他反射那个类,也就是代码没写全,针对你这个问题刚写了个例子:
http://blog.csdn.net/xionglangs/article/details/53575858