Example usage for com.google.gwt.core.ext.typeinfo JPrimitiveType parse

List of usage examples for com.google.gwt.core.ext.typeinfo JPrimitiveType parse

Introduction

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

Prototype

public static JPrimitiveType parse(String name) 

Source Link

Usage

From source file:com.github.nmorel.gwtjackson.rebind.RebindConfiguration.java

License:Apache License

/**
 * @param clazz class to find the type/*from   ww  w.ja v a2  s . c  o m*/
 *
 * @return the {@link JType} denoted by the class given in parameter
 */

private JType findType(Class<?> clazz) {
    if (clazz.isPrimitive()) {

        return JPrimitiveType.parse(clazz.getCanonicalName());

    } else if (clazz.isArray()) {

        try {
            return context.getTypeOracle().parse(clazz.getCanonicalName());
        } catch (TypeOracleException e) {
            logger.log(TreeLogger.WARN,
                    "Cannot find the array denoted by the class " + clazz.getCanonicalName());
            return null;
        }

    } else {
        return findClassType(clazz);
    }
}