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

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


      String content = attrMap.getOptional("content", null);
      Type defaultType = null;
      boolean consumesContent = content != null;
      if (consumesContent) {
        if (!"*".equals(content)) {
          alertSink.add(new InvalidAttributeValueError(attrMap.getAttribute("content")));
        }
        if (rootSchema != null) {
          defaultType = new ContentType(node.getSourcePosition(),
                                        node.getDisplayName(),
                                        rootSchema);
View Full Code Here


      String name = attrMap.get("name", null);
      String example = attrMap.getOptional("example", null);
      if (example != null) {
        if (example.trim().length() == 0) {
          alertSink.add(
              new InvalidAttributeValueError(attrMap.getAttribute("example")));
          example = "<var>" + name + "</var>";
        }
      }
      if (name != null) {
        output.accumulate(new PlaceholderStart(node, null, name, example));
View Full Code Here

      String elementStr = attrMap.getOptional("element", null);
      if (elementStr != null) {
        try {
          element = JavaAnnotation.Element.valueOf(elementStr.toUpperCase());
        } catch (IllegalArgumentException e) {
          alertSink.add(new InvalidAttributeValueError(attrMap.getValue("element", null)));
          with = null;
        }
      }

      if (with != null) {
View Full Code Here

          } else {
            Expression attrValue = attr.getValue();
            if (attrValue instanceof StringConstant) {
              String value = ((StringConstant) attrValue).evaluate();
              if (!attrValidator.isValidValue(value)) {
                alertSink.add(new InvalidAttributeValueError(attr));
              }
            }

            // if the attribute validator indicates an inner content type then
            // set this on the attribute
View Full Code Here

    if (str == null || str.equals("false")) {
      return false;
    } else if (str.equals("true")) {
      return true;
    } else {
      alertSink.add(new InvalidAttributeValueError(getAttribute(name)));
      return false;
    }
  }
View Full Code Here

    assertNoUnexpectedAlerts();
  }

  public void testMsg_badHiddenAttribute() throws Exception {
    compile("<gxp:msg hidden='no'>foo</gxp:msg>");
    assertAlert(new InvalidAttributeValueError(pos(2,1), "'hidden' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    assertNoUnexpectedAlerts();
  }

  public void testNamedMsg_badHiddenAttribute() throws Exception {
    compile("<gxp:msg name='NAME' hidden='no'>foo</gxp:msg>");
    assertAlert(new InvalidAttributeValueError(pos(2,1), "'hidden' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    compile("<gxp:msg>",
            "<gxp:ph example='' name='foo'/>",
            "<gxp:eval expr='x'/>",
            "<gxp:eph/>",
            "</gxp:msg>");
    assertAlert(new InvalidAttributeValueError(pos(3, 1),
                                               "'example' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    assertNoUnexpectedAlerts();
  }

  public void testParam_invalidContent() throws Exception {
    compile("<gxp:param name='foo' content='bar' />");
    assertAlert(new InvalidAttributeValueError(pos(2,1),
                                               "'content' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

TOP

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

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.