Type genType = getClass().getGenericSuperclass();
        if (!(genType instanceof ParameterizedType)) {    
            genType = getClass().getSuperclass().getGenericSuperclass();
        }
        Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
        Class realClass = (Class) params[0];

 

posted on 2020-05-13 21:32  yytxdy  阅读(1528)  评论(0编辑  收藏  举报