Examples of JPrimitiveType


Examples of com.google.gwt.core.ext.typeinfo.JPrimitiveType

    if (param == null) {
      return "null";
    } else if (param.getType().isArray() != null) {
      return "array";
    } else if (param.getType().isPrimitive() != null) {
      JPrimitiveType prim = param.getType().isPrimitive();
      return prim == JPrimitiveType.BOOLEAN ? "boolean" : "number";
    } else if (exportableEnclosingType.getExportableTypeOracle()
        .isString(param.getType())) {
      return "string";
    } else if (exportableEnclosingType.getExportableTypeOracle()
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JPrimitiveType

    String prop = name.startsWith("set") ? name.substring(3) : name;
    return Character.toLowerCase(prop.charAt(0))+prop.substring(1);
  }

  public String getFieldLowestType() {
    JPrimitiveType type = setterMethod.getParameters()[0].getType()
        .isPrimitive();
    return type != null ? type.getQualifiedSourceName() : "Object";
  }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JPrimitiveType

    if (param == null) {
      return "null";
    } else if (param.getType().isArray() != null) {
      return "array";
    } else if (param.getType().isPrimitive() != null) {
      JPrimitiveType prim = param.getType().isPrimitive();
      return prim == JPrimitiveType.BOOLEAN ? "boolean" : "number";
    } else if (xto.isString(param.getType())) {
      return "string";
    } else if (xto.isJavaScriptObject(param.getType())) {
      return "object";
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JPrimitiveType

  public String getWrapperFunc() {
    return null;
  }

  public String getJsTypeOf() {
    JPrimitiveType prim = primitive.isPrimitive();
    return prim == JPrimitiveType.BOOLEAN ? "boolean" : "number";
  }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JPrimitiveType

    return type.isPrimitive() != null;
  }

  @Override
  String defaultValue(TypeOracle oracle, JType type) {
    JPrimitiveType returnType = type.isPrimitive();

    if (returnType.equals(JPrimitiveType.BOOLEAN)) {
      return "false";

    } else if (returnType.equals(JPrimitiveType.CHAR)) {
      return "32";

    } else {
      return "0";
    }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JPrimitiveType

                w.print(", ");
            }

            w.print("params[" + i + "]");

            JPrimitiveType primitive = parameterTypes[i].isPrimitive();
            if (primitive != null) {
                // param.intValue();
                w.print(".@%s::%sValue()()",
                        primitive.getQualifiedBoxedSourceName(),
                        primitive.getQualifiedSourceName());
            }
        }

        if (hasPrimitiveReturnType) {
            assert hasReturnType;
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JPrimitiveType

        return propertyType;
    }

    public String getUnboxedPropertyTypeName() {
        JType propertyType = getPropertyType();
        JPrimitiveType primitive = propertyType.isPrimitive();
        if (primitive != null) {
            return primitive.getQualifiedBoxedSourceName();
        } else {
            return propertyType.getQualifiedSourceName();
        }
    }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JPrimitiveType

            return propertyType.getQualifiedSourceName();
        }
    }

    public String boxValue(String codeSnippet) {
        JPrimitiveType primitive = propertyType.isPrimitive();
        if (primitive == null) {
            return codeSnippet;
        } else {
            return String.format("@%s::valueOf(%s)(%s)",
                    primitive.getQualifiedBoxedSourceName(),
                    propertyType.getJNISignature(), codeSnippet);
        }
    }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JPrimitiveType

                    propertyType.getJNISignature(), codeSnippet);
        }
    }

    public String unboxValue(String codeSnippet) {
        JPrimitiveType primitive = propertyType.isPrimitive();
        if (primitive == null) {
            return codeSnippet;
        } else {
            return String.format("%s.@%s::%sValue()()", codeSnippet,
                    primitive.getQualifiedBoxedSourceName(),
                    primitive.getSimpleSourceName());
        }
    }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JPrimitiveType

  }

  private String getBinaryOrPrimitiveName(JType type) {
    JArrayType asArray = type.isArray();
    JClassType asClass = type.isClassOrInterface();
    JPrimitiveType asPrimitive = type.isPrimitive();
    if (asClass != null) {
      return getBinaryName(asClass);
    } else if (asPrimitive != null) {
      return asPrimitive.getQualifiedSourceName();
    } else if (asArray != null) {
      JType componentType = asArray.getComponentType();
      return getBinaryOrPrimitiveName(componentType) + "[]";
    } else {
      throw new InternalCompilerException("Cannot create binary name for "
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.