Package com.google.gxp.compiler.base

Examples of com.google.gxp.compiler.base.NativeExpression


                           Expression subexpression) {
    return new EscapeExpression(schema, subexpression);
  }

  public NativeExpression expr(String expr) {
    return new NativeExpression(pos(), "(" + expr + ")", new MultiLanguageAttrValue(expr),
                                null, null);
  }
View Full Code Here


    assertEquals(schema, result.getSchema());
  }

  public void testExpr() throws Exception {
    String nativeCode = "6 * 9";
    NativeExpression result = expr(nativeCode);
    assertEquals(nativeCode, result.getDefaultNativeCode());
  }
View Full Code Here

          public Attribute visitExprNamespace(ExprNamespace ns) {
            MultiLanguageAttrValue value = new MultiLanguageAttrValue(parsedAttr.getValue());
            return new Attribute(parsedAttr, NullNamespace.INSTANCE,
                                 parsedAttr.getName(),
                                 new NativeExpression(parsedAttr, value));
          }

          public Attribute visitGxpNamespace(GxpNamespace ns) {
            return defaultVisitNamespace(ns);
          }
View Full Code Here

      String example = attrMap.getOptional("example", null);
      String phName = attrMap.getOptional(GxpNamespace.INSTANCE, "ph", null);
      if (expr.isEmpty()) {
        alertSink.add(new MissingAttributeError(node, "expr"));
      } else {
        output.accumulate(new NativeExpression(node, expr, example, phName));
      }
      return null;
    }
View Full Code Here

    for (Map.Entry<AttributeName, Attribute> entry : namesToAttrs.entrySet()) {
      Attribute attr = entry.getValue();
      Expression value = attr.getValue();
      if ((attr.getNamespace() instanceof NullNamespace) && value instanceof StringConstant) {
        String s = ((StringConstant) value).evaluate();
        entry.setValue(attr.withValue(new NativeExpression(value, new MultiLanguageAttrValue(s))));
      }
    }
  }
View Full Code Here

      if (!optional) {
        alertSink.add(new MissingAttributeError(forNode, name));
      }
      return fallback;
    }
    return new NativeExpression(forNode.getSourcePosition(), "'" + name + "' attribute", mlar);
  }
View Full Code Here

          public Attribute visitExprNamespace(ExprNamespace ns) {
            MultiLanguageAttrValue value = new MultiLanguageAttrValue(parsedAttr.getValue());
            return new Attribute(parsedAttr, NullNamespace.INSTANCE,
                                 parsedAttr.getName(),
                                 new NativeExpression(parsedAttr, value));
          }

          public Attribute visitGxpNamespace(GxpNamespace ns) {
            return defaultVisitNamespace(ns);
          }
View Full Code Here

    for (Map.Entry<AttributeName, Attribute> entry : namesToAttrs.entrySet()) {
      Attribute attr = entry.getValue();
      Expression value = attr.getValue();
      if ((attr.getNamespace() instanceof NullNamespace) && value instanceof StringConstant) {
        String s = ((StringConstant) value).evaluate();
        entry.setValue(attr.withValue(new NativeExpression(value, new MultiLanguageAttrValue(s))));
      }
    }
  }
View Full Code Here

      if (!optional) {
        alertSink.add(new MissingAttributeError(forNode, name));
      }
      return fallback;
    }
    return new NativeExpression(forNode.getSourcePosition(), "'" + name + "' attribute", mlar);
  }
View Full Code Here

      String example = attrMap.getOptional("example", null);
      String phName = attrMap.getOptional(GxpNamespace.INSTANCE, "ph", null);
      if (expr.isEmpty()) {
        alertSink.add(new MissingAttributeError(node, "expr"));
      } else {
        output.accumulate(new NativeExpression(node, expr, example, phName));
      }
      return null;
    }
View Full Code Here

TOP

Related Classes of com.google.gxp.compiler.base.NativeExpression

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.