Package com.google.gxp.compiler.base

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


  }

  private Attribute injectAttribute() {
    String attrValue = "[foo's value]";
    Attribute node = new Attribute(FROM_NODE, NullNamespace.INSTANCE, "foo",
                                   new StringConstant(FROM_NODE, null,
                                                      attrValue),
                                   null, null);
    parts.accumulate(node);
    return node;
  }
View Full Code Here


    Namespace namespace = parsedAttr.getNamespace();
    return namespace.acceptVisitor(
        new NamespaceVisitor<Attribute>() {
          private Attribute defaultVisitNamespace(Namespace ns) {
            return new Attribute(parsedAttr, ns, parsedAttr.getName(),
                                 new StringConstant(parsedAttr, null, parsedAttr.getValue()));
          }

          public Attribute visitCallNamespace(CallNamespace ns) {
            throw new Error("TODO(laurence): implement");
          }

          public Attribute visitCppNamespace(CppNamespace ns) {
            return defaultVisitNamespace(ns);
          }

          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);
          }

          public Attribute visitJavaNamespace(JavaNamespace ns) {
            return defaultVisitNamespace(ns);
          }

          public Attribute visitJavaScriptNamespace(JavaScriptNamespace ns) {
            return defaultVisitNamespace(ns);
          }

          public Attribute visitMsgNamespace(MsgNamespace ns) {
            Expression str = new StringConstant(parsedAttr, null, parsedAttr.getValue());
            Expression msg = new UnextractedMessage(
                parsedAttr, null, new MultiLanguageAttrValue(""), null, null, false, str);
            return new Attribute(parsedAttr, NullNamespace.INSTANCE, parsedAttr.getName(),
                                 new ConvertibleToContent(msg));
          }

          public Attribute visitNoMsgNamespace(NoMsgNamespace ns) {
            Expression str = new StringConstant(parsedAttr, null, parsedAttr.getValue());
            Expression nomsg = new NoMessage(parsedAttr.getSourcePosition(),
                                             String.format("%s namespace on %s attribute",
                                                           ns.getUri(), parsedAttr.getName()),
                                             str);
            return new Attribute(parsedAttr, NullNamespace.INSTANCE, parsedAttr.getName(),
View Full Code Here

        Conditional.Clause lastClause = clauses.get(clauses.size() - 1);
        if (lastClause.getPredicate().alwaysEquals(true)) {
          elseExpression = lastClause.getExpression();
          clauses = clauses.subList(0, clauses.size() - 1);
        } else {
          elseExpression = new StringConstant(node, null, "");
        }
      }

      if (clauses.isEmpty()) {
        if (elseExpression == null) {
View Full Code Here

      String key = getVariableName(attrMap, "key", true);
      String var = getVariableName(attrMap, "var", false);
      Expression content = getCollapsableContent(attrMap);

      Expression delimiter = attrMap.getOptionalAttributeValue(
          "delimiter", new StringConstant(node, null, " "));

      Expression iterator = attrMap.getOptionalExprValue("iterator", null);
      Expression iterable = attrMap.getOptionalExprValue("iterable", null);

      if (iterable == null && iterator == null) {
View Full Code Here

      // passed values.
      // TODO(laurence): should gxp:param even support nested content?
      Expression comment = nodeParts.getContent();
      if (!comment.hasStaticString()) {
        alertSink.add(new RequiresStaticContentError(node));
        comment = new StringConstant(node, null, "");
      }
      if (name != null) {
        FormalParameter formal = new FormalParameter(node, name, consumesContent, type,
                                                     defaultValue, hasDefaultFlag, regex,
                                                     constructor, hasConstructorFlag,
View Full Code Here

      // NOENDTAG in Validator phase.
      Expression content;
      if (validator.isFlagSet(ElementValidator.Flag.NOENDTAG)) {
        // Ignore supplied children. EditableParts will generate alerts about
        // them if necessary.
        content = new StringConstant(node, null, "");
      } else {
        content = getCollapsableContent(attrMap);
      }

      String innerContentTypeString = validator.getInnerContentType();
View Full Code Here

      }
      return null;
    }

    public Void visitTextElement(TextElement node) {
      output.accumulate(new StringConstant(node, null, node.getText()));
      return null;
    }
View Full Code Here

TOP

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

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.