Example usage for com.google.gwt.core.ext.typeinfo JTypeParameter getErasedType

List of usage examples for com.google.gwt.core.ext.typeinfo JTypeParameter getErasedType

Introduction

In this page you can find the example usage for com.google.gwt.core.ext.typeinfo JTypeParameter getErasedType.

Prototype

JClassType getErasedType();

Source Link

Usage

From source file:org.jboss.errai.codegen.meta.impl.gwt.GWTUtil.java

License:Apache License

public static MetaClass eraseOrReturn(final TypeOracle oracle, final JType t) {

    if (t.isArray() != null) {
        final JType root = getRootComponentType(t.isArray());
        if (root.isTypeParameter() != null) {
            return MetaClassFactory.get(Object.class);
        }/*w w  w . j a v a 2  s .  c  o  m*/
    }
    if (t.isTypeParameter() != null) {
        JTypeParameter tp = t.isTypeParameter();
        return MetaClassFactory.get(tp.getErasedType().getQualifiedBinaryName());
    }
    return GWTClass.newInstance(oracle, t);
}