Package com.google.gxp.compiler.base

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


          Expression attrValue = attr.getValue().acceptVisitor(this);
          if (attrValue.hasStaticString()) {
            values.add(buildBooleanAttrExpression(attr, element));
          } else {
            if (attrValue instanceof ConvertibleToContent) {
              ConvertibleToContent ctc = (ConvertibleToContent)attrValue;
              attrValue = ctc.getSubexpression();
            }
            values.add(new Conditional(element, elementSchema,
                                       attrValue,
                                       buildBooleanAttrExpression(attr, element),
                                       empty));
View Full Code Here


          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(),
                                 new ConvertibleToContent(nomsg));
          }

          public Attribute visitNullNamespace(NullNamespace ns) {
            return defaultVisitNamespace(ns);
          }
View Full Code Here

      String name = attrMap.get("name", null);
      if (name != null) {
        // TODO(laurence): make it possible to have attr elements for other
        // namespaces?
        Expression content =
            new ConvertibleToContent(getCollapsableContent(attrMap));
        Expression condition = attrMap.getOptionalExprValue("cond", null);
        output.accumulate(new Attribute(node, name, content, condition));
      }
      return null;
    }
View Full Code Here

    // CallNamespace elements
    public Void visitCallElement(CallNamespace.CallElement node) {
      AttributeMap attrMap = nodeParts.getAttributes();
      ImmutableMap.Builder<String, Attribute> attrBuilder = ImmutableMap.builder();
      Expression content = new ConvertibleToContent(getCollapsableContent(attrMap));
      List<String> bundles = getBundles(attrMap);

      for (Attribute attr : attrMap.getUnusedAttributes()) {
        if (attr.getNamespace() instanceof NullNamespace) {
          Expression value = attr.getValue();
View Full Code Here

          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(),
                                 new ConvertibleToContent(nomsg));
          }

          public Attribute visitNullNamespace(NullNamespace ns) {
            return defaultVisitNamespace(ns);
          }
View Full Code Here

      String name = attrMap.get("name", null);
      if (name != null) {
        // TODO(laurence): make it possible to have attr elements for other
        // namespaces?
        Expression content =
            new ConvertibleToContent(getCollapsableContent(attrMap));
        Expression condition = attrMap.getOptionalExprValue("cond", null);
        output.accumulate(new Attribute(node, name, content, condition));
      }
      return null;
    }
View Full Code Here

    // CallNamespace elements
    public Void visitCallElement(CallNamespace.CallElement node) {
      AttributeMap attrMap = nodeParts.getAttributes();
      ImmutableMap.Builder<String, Attribute> attrBuilder = ImmutableMap.builder();
      Expression content = new ConvertibleToContent(getCollapsableContent(attrMap));
      List<String> bundles = getBundles(attrMap);

      for (Attribute attr : attrMap.getUnusedAttributes()) {
        if (attr.getNamespace() instanceof NullNamespace) {
          Expression value = attr.getValue();
View Full Code Here

TOP

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

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.