Example usage for java.lang.reflect TypeVariable getClass

List of usage examples for java.lang.reflect TypeVariable getClass

Introduction

In this page you can find the example usage for java.lang.reflect TypeVariable getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.autentia.common.util.ClassWithList.java

private <T> void printInfo(List<T> list) throws SecurityException, NoSuchMethodException {

    final TypeVariable<?>[] types = list.getClass().getTypeParameters();

    for (TypeVariable<?> clazz : types) {
        print(clazz);/* w  ww .j av a  2 s  .c o  m*/

        // ParameterizedType pt = (ParameterizedType)clazz;

        // log.debug(clazz.getName() + " | " + clazz.getGenericDeclaration().getClass().getName());
        //
        for (TypeVariable<?> type : clazz.getGenericDeclaration().getTypeParameters()) {
            ParameterizedType pt = (ParameterizedType) type;
            log.debug(type.getClass().getName());
        }
        //         
        // for (Type type : clazz.getBounds()) {
        // ParameterizedType pt = (ParameterizedType)type;
        // print(pt);
        // log.debug(pt.getOwnerType());
        // log.debug(pt.getRawType());
        // log.debug(pt.getActualTypeArguments());
        // }
    }
}