Package com.google.gwt.core.ext.typeinfo

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


      else
      {
        for (Annotation annotation : annotations)
        {
          JParameter parameter = parameters[i];
          JType parameterType = parameter.getType();
          String parameterName = parameter.getName();
          formEncoded = generateMethodParamToBodyCodeForAnnotatedParameter(srcWriter, builder, parameters, formEncoded, i, annotation, parameterType, parameterName);
        }
      }
    }
View Full Code Here


      for (org.cruxframework.crux.core.client.datasource.annotation.ColumnDefinition columnDefinition : columnDefinitions.value())
        {
        StringBuilder getValueExpression = new StringBuilder();
        String colKey = columnDefinition.value();

        JType propType;
        try
        {
          propType = JClassUtils.buildGetValueExpression(getValueExpression, dtoType, colKey, "recordObject", true);
        }
        catch (Exception e)
        {
          throw new CruxGeneratorException("Datasource ["+dataSourceClass.getQualifiedSourceName()+"] has an invalid ColumnDefinition ["+colKey+"].");
        }

        JClassType comparableType = context.getTypeOracle().findType(Comparable.class.getCanonicalName());

        boolean isSortable = (propType.isPrimitive() != null) || (comparableType.isAssignableFrom((JClassType) propType));
        String propTypeName = JClassUtils.getGenericDeclForType(propType);
        out.println(colDefs+".addColumn(new "+org.cruxframework.crux.core.client.datasource.ColumnDefinition.class.getCanonicalName()+
            "<"+propTypeName+","+dtoClassName+">("+EscapeUtils.quote(colKey)+","+isSortable+"){");
        out.println("public "+propTypeName+" getValue("+dtoClassName+" recordObject){");
        out.println("return "+getValueExpression.toString());
View Full Code Here

      String[] fields = RegexpPatterns.REGEXP_DOT.split(identifier[i]);
      if (fields != null)
      {
        StringBuilder fieldExpression = new StringBuilder();
        boolean first = true;
        JType propertyType = dtoType;
        for (String fieldName : fields)
                {
          JClassType jClassPropertyType = (JClassType)propertyType;
          if (first)
          {
View Full Code Here

   * @param methodName
   * @return
   */
  private JClassType getTypeFromMethodClass(String methodName)
    {
    JType returnType = JClassUtils.getReturnTypeFromMethodClass(dataSourceClass, methodName, new JType[]{});
    JClassType returnClassType = returnType.isClassOrInterface();
   
    if (returnClassType == null)
    {
      throw new CruxGeneratorException("Error Generating DataSource ["+dataSourceClass.getName()+"]. Invalid Bound object. Primitive is not allowed");
    }
View Full Code Here

    JField[] fields = JClassUtils.getDeclaredFields(dtoType);
    for (int i = 0; i < fields.length; i++)
    {
      JField field = fields[i];
      String name = field.getName();
      JType type = field.getType();
      String typeName = type.getQualifiedSourceName();
     
      if (type.isPrimitive() != null)
      {
        JPrimitiveType jPrimitiveType = type.isPrimitive();
        typeName = jPrimitiveType.getQualifiedBoxedSourceName();
      }
     
      srcWriter.println();
     
View Full Code Here

    String elseStm = "";
    for (int i = 0; i < fields.length; i++)
    {
      JField field = fields[i];
      String name = field.getName();
      JType type = field.getType();
      String typeName = type.getQualifiedSourceName();
     
      if (type.isPrimitive() != null)
      {
        JPrimitiveType jPrimitiveType = type.isPrimitive();
        typeName = jPrimitiveType.getQualifiedBoxedSourceName();
      }
     
      srcWriter.println();
     
View Full Code Here

   
    for (int i = 0; i < fields.length; i++)
    {
      JField field = fields[i];
      String name = field.getName();
      JType fieldType = field.getType();
      String fieldTypeName = fieldType.getParameterizedQualifiedSourceName();
      String setterName = null;
      String getterName = null;

      if (fieldType.isPrimitive() != null)
      {
        JPrimitiveType jPrimitiveType = fieldType.isPrimitive();
        fieldTypeName = jPrimitiveType.getQualifiedBoxedSourceName();
      }
     
      try
      {
View Full Code Here

    if (objectStoreKeyPath.length > 1)
    {
      for (int i = 0; i < objectStoreKeyPath.length; i++)
      {
        String k = objectStoreKeyPath[i];
        JType jType = JClassUtils.getTypeForProperty(k, targetObjectType);
        String setterMethod = JClassUtils.getSetterMethod(k, targetObjectType, jType);
        srcWriter.println("object."+setterMethod+"((key==null?null:("+jType.getParameterizedQualifiedSourceName()+")key["+i+"]));");
      }
    }
    else
    {
      String k = objectStoreKeyPath[0];
      JType jType = JClassUtils.getTypeForProperty(k, targetObjectType);
      String setterMethod = JClassUtils.getSetterMethod(k, targetObjectType, jType);
      srcWriter.println("object."+setterMethod+"(key);");
    }
    srcWriter.println("}");
    srcWriter.println();
View Full Code Here

        srcWriter.println("if (key == null){");
        srcWriter.println("result.push((String)null);");
        srcWriter.println("return;");
        srcWriter.println("}");

        JType jType = getPropertyType(keyPath[0]);
        if (jType.equals(stringType))
        {
          srcWriter.println("result.push((String)key);");
        }
        else if (jType.equals(integerType) || (jType.equals(JPrimitiveType.INT)))
        {
          srcWriter.println("result.push((int)key);");
        }
        else if (jType.equals(doubleType) || (jType.equals(JPrimitiveType.DOUBLE)))
        {
          srcWriter.println("result.push((double)key);");
        }
        else if (jType.equals(dateType))
        {
          srcWriter.println("result.push((double)(("+Date.class.getCanonicalName()+")key).getTime());");
        }
        else
        {
View Full Code Here

      }
  }

  protected JType getPropertyType(String property)
    {
      JType jType = JClassUtils.getTypeForProperty(property, targetObjectType);
      if (jType == null)
      {
        throw new CruxGeneratorException("Invalid property for objectStore ["+targetObjectType.getParameterizedQualifiedSourceName()+"]");
      }
      return jType;
View Full Code Here

TOP

Related Classes of com.google.gwt.core.ext.typeinfo.JType

Copyright © 2018 www.massapicom. 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.