Examples of JPrimitiveType


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

   *
   * @param type TypeOracle type to get the name for
   * @return binary name for a type
   */
  public static String computeBinaryClassName(JType type) {
    JPrimitiveType primitiveType = type.isPrimitive();
    if (primitiveType != null) {
      return primitiveType.getJNISignature();
    }

    JArrayType arrayType = type.isArray();
    if (arrayType != null) {
      JType component = arrayType.getComponentType();
View Full Code Here

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

      if (pluralCount != null) {
        if (pluralParamIndex >= 0) {
          throw error(logger, m.getName()
              + ": there can only be one PluralCount parameter");
        }
        JPrimitiveType primType = params[i].getType().isPrimitive();
        if (primType != JPrimitiveType.INT && primType != JPrimitiveType.SHORT) {
          throw error(logger, m.getName()
              + ": PluralCount parameter must be int or short");
        }
        pluralParamIndex = i;
View Full Code Here

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

   * Implements {x,number...} references in MessageFormat.
   */
  private static class NumberFormatter implements ValueFormatter {
    public String format(StringGenerator out, String subformat, String argName,
        JType argType) {
      JPrimitiveType argPrimType = argType.isPrimitive();
      if (argPrimType != null) {
        if (argPrimType == JPrimitiveType.BOOLEAN
            || argPrimType == JPrimitiveType.VOID) {
          return "Illegal argument type for number format";
        }
View Full Code Here

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

    if (classReturnType != null
        && "java.lang.String".equals(classReturnType.getQualifiedSourceName())) {
      returnExpr = "\"" + Generator.escape(def.getValues().get(0).toString())
          + "\"";
    } else {
      JPrimitiveType returnType = toImplement.getReturnType().isPrimitive();
      if (returnType == null) {
        logger.log(TreeLogger.ERROR, toImplement.getName()
            + ": Return type must be primitive type or String for "
            + "@def accessors");
        throw new UnableToCompleteException();
      }
      if (returnType == JPrimitiveType.INT || returnType == JPrimitiveType.LONG) {
        returnExpr = "" + Math.round(numberValue.getValue());
      } else if (returnType == JPrimitiveType.FLOAT) {
        returnExpr = numberValue.getValue() + "F";
      } else if (returnType == JPrimitiveType.DOUBLE) {
        returnExpr = "" + numberValue.getValue();
      } else {
        logger.log(TreeLogger.ERROR, returnType.getQualifiedSourceName()
            + " is not a valid primitive return type for @def accessors");
        throw new UnableToCompleteException();
      }
    }
    sw.print(toImplement.getReadableDeclaration(false, false, false, false,
View Full Code Here

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

        return typeOracle.findType(typeName);
  }
 
  public String getSQLiteType(JType returnType) {
    String sqliteType = null;
    JPrimitiveType primitiveReturnType = returnType.isPrimitive();
    if (primitiveReturnType != null) {
      if (primitiveReturnType == JPrimitiveType.INT)
      {
        sqliteType = "INTEGER";
      }
      else if (primitiveReturnType == JPrimitiveType.BOOLEAN)
      {
        sqliteType = "BOOL";
      }
      else {
        sqliteType = primitiveReturnType.getSimpleSourceName().toUpperCase();
      }
    }
    else
    {
      String returnTypeName = returnType.getSimpleSourceName();
View Full Code Here

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

      {
        for (PropertyInfo propertyInfo : propertiesInfo)
        {
          if (JClassUtils.isSimpleType(propertyInfo.getType()))
          {
            JPrimitiveType primitiveType = propertyInfo.getType().isPrimitive();
            if (propertyInfo.getType().getQualifiedSourceName().equals(String.class.getCanonicalName()))
            {
              srcWriter.println("if ("+(empty?"!":"")+"StringUtils.isEmpty("+objVariable+"."+propertyInfo.getReadMethod().getName()+"())){");
              srcWriter.println("return false;");
              srcWriter.println("}");
View Full Code Here

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

      {
        for (PropertyInfo propertyInfo : propertiesInfo)
        {
          if (JClassUtils.isSimpleType(propertyInfo.getType()))
          {
            JPrimitiveType primitiveType = propertyInfo.getType().isPrimitive();
            JEnumType enumType = propertyInfo.getType().isEnum();
            JClassType classType = propertyInfo.getType().isClassOrInterface();
            if (primitiveType != null || enumType != null)
            {
              srcWriter.println("if ("+objVariable+"."+propertyInfo.getReadMethod().getName()+"() != "+otherVariable+"."+propertyInfo.getReadMethod().getName()+"()){");
View Full Code Here

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

  }

  private static List<Class<?>> getAllowedType(JType jType)
  {
    List<Class<?>> result = new ArrayList<Class<?>>();
    JPrimitiveType primitiveType = jType.isPrimitive();
    if (primitiveType == JPrimitiveType.INT || jType.getQualifiedSourceName().equals(Integer.class.getCanonicalName()))
    {
      result.add(Integer.TYPE);
      result.add(Integer.class);
    }
View Full Code Here

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

   */
  public static String getGenericDeclForType(JType type)
  {
    if (type.isPrimitive() != null)
    {
      JPrimitiveType jPrimitiveType = type.isPrimitive();
      return jPrimitiveType.getQualifiedBoxedSourceName();
    }
    else
    {
      return type.getParameterizedQualifiedSourceName();
    }
View Full Code Here

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

  }
 
 
  public static String getEmptyValueForType(JType objectType)
    {
    JPrimitiveType primitiveType = objectType.isPrimitive();
    if (primitiveType != null)
    {
      if ((primitiveType == JPrimitiveType.INT)
          ||(primitiveType == JPrimitiveType.SHORT)
          ||(primitiveType == JPrimitiveType.LONG)
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.