Package com.google.gxp.compiler.alerts.common

Examples of com.google.gxp.compiler.alerts.common.MultiValueAttributeError


    attr = attr(NullNamespace.INSTANCE, "foo", str("baz"));
    attrMap.add(attr);
    attrMap.get("foo", "bar");

    expectedAlerts.add(new MultiValueAttributeError(fromNode, attr));

    attrMap.reportUnusedAttributes();
  }
View Full Code Here


    // at this point attributes that are unused aren't strictly unknown, so
    // much as incompatible with other attributes, so add Alerts indicating this.
    for (Map.Entry<AttributeName, Attribute> entry : namesToAttrs.entrySet()) {
      if (!used.contains(entry.getKey())) {
        used.add(entry.getKey());
        alertSink.add(new MultiValueAttributeError(forNode, entry.getValue()));
      }
    }

    return ImmutableList.copyOf(result);
  }
View Full Code Here

   * Adds the specified {@code Attribute}.
   */
  public void add(final Attribute attr) {
    AttributeName key = new AttributeName(attr.getNamespace(), attr.getName());
    if (namesToAttrs.containsKey(key)) {
      alertSink.add(new MultiValueAttributeError(forNode, attr));
    } else {
      namesToAttrs.put(key, attr);
    }
  }
View Full Code Here

  public void testCall_NullAndLanguageAttribute() throws Exception {
    FileRef callee = createFile("callee", "<gxp:param name='s' type='String' />");
    FileRef caller = createFile("caller", "<call:callee s='foo' java:s='bar' />");
    compileFiles(callee, caller);
    assertAlert(new MultiValueAttributeError(pos(2,1), "<call:callee>", "'java:s' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    compile("<div java:class='bar'>",
            "  <gxp:attr name='class'>",
            "    foo",
            "  </gxp:attr>",
            "</div>");
    assertAlert(new MultiValueAttributeError(pos(2,1), "<div>", "'java:class' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    assertNoUnexpectedAlerts();
  }

  public void testOutputElement_NullAndLanguageAttribute() throws Exception {
    compile("<div class='foo' java:class='bar'/>");
    assertAlert(new MultiValueAttributeError(pos(2,1), "<div>", "'java:class' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    assertNoUnexpectedAlerts();
  }

  public void testOutputElement_NullExprAndLanguageAttribute() throws Exception {
    compile("<div class='foo' expr:class='bar' java:class='baz'/>");
    assertAlert(new MultiValueAttributeError(pos(2,1), "<div>", "'expr:class' attribute"));
    assertAlert(new MultiValueAttributeError(pos(2,1), "<div>", "'java:class' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

                                "    5",
                                "  </gxp:attr>",
                                "</call:callee>");
    compileFiles(callee, caller);

    assertAlert(new MultiValueAttributeError(pos(4, 3), "<call:callee>", "'y' attribute"));
    assertAlert(new MultiValueAttributeError(pos(10, 3), "<call:callee>", "'y' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    caller = createFile("caller",
                        "<call:callee expr:body='HtmlClosures.EMPTY'>",
                        "  foo",
                        "</call:callee>");
    compileFiles(callee, caller);
    assertAlert(new MultiValueAttributeError(pos(2,1), "<call:callee>", "'body' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

TOP

Related Classes of com.google.gxp.compiler.alerts.common.MultiValueAttributeError

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.