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

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


                                "<gxp:param name='bundle' gxp:type='bundle'",
                                "           from-element='div' />",
                                "<call:callee gxp:bundles='bundle' />");

    compileFiles(callee, caller);
    assertAlert(new UnknownAttributeError("<call:callee>", pos(4,1), "align"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here


    compile("<gxp:param name='bundle' gxp:type='bundle' from-element='img'",
            "           exclude='alt,align' />",
            "<div gxp:bundles='bundle'/>");

    // all of the various attributes that exist for img, but not div
    assertAlert(new UnknownAttributeError("<div>", pos(4,1), "border"));
    assertAlert(new UnknownAttributeError("<div>", pos(4,1), "height"));
    assertAlert(new UnknownAttributeError("<div>", pos(4,1), "hspace"));
    assertAlert(new UnknownAttributeError("<div>", pos(4,1), "ismap"));
    assertAlert(new UnknownAttributeError("<div>", pos(4,1), "longdesc"));
    assertAlert(new UnknownAttributeError("<div>", pos(4,1), "name"));
    assertAlert(new UnknownAttributeError("<div>", pos(4,1), "onload"));
    assertAlert(new UnknownAttributeError("<div>", pos(4,1), "src"));
    assertAlert(new UnknownAttributeError("<div>", pos(4,1), "usemap"));
    assertAlert(new UnknownAttributeError("<div>", pos(4,1), "vspace"));
    assertAlert(new UnknownAttributeError("<div>", pos(4,1), "width"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

                                             "<gxp:eval>", "<gxp:eval>", 2, 1);
  }

  public void testShortEval() throws Exception {
    compile("<expr:x java:expr='x' />");
    assertAlert(new UnknownAttributeError("<expr:x>", pos(2,1), "'java:expr' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    assertAlert(new MissingExpressionError(pos(2, 1), "'iterator' attribute", "Java"));
    assertAlert(new LoopRequiresIterableInJavaScriptError(pos(2, 1), "<gxp:loop>"));
    assertNoUnexpectedAlerts();

    compile("<gxp:loop var='v' type='t' js:iterator='e' />");
    assertAlert(new UnknownAttributeError("<gxp:loop>", pos(2, 1), "'js:iterator' attribute"));
    assertNoUnexpectedAlerts();

    // both tests
    compile("<gxp:loop var='v' type='t' java:iterator='e' js:iterable='e' />");
    assertNoUnexpectedAlerts();
View Full Code Here

            // attribute or this attribute isn't allowed at all
            if (allowedAttributes.contains(attr.getKey())) {
              alertSink.add(new DuplicateAttributeError(node, attrBundle,
                                                        attr.getKey()));
            } else {
              alertSink.add(new UnknownAttributeError(node, attr.getKey()));
            }
          } else if (!validator.equals(attr.getValue())) {
            alertSink.add(new MismatchedAttributeValidatorsError(
                              node, attr.getKey(), parameter.getPrimaryName()));
          } else {
View Full Code Here

      // special case to disallow JavaScript iterator attribute this
      // isn't in JavaScriptCodeGenerator, because we want to generate an
      // alert for this even if we aren't generating JS code
      Attribute jsIterator = attrMap.getAttribute(JavaScriptNamespace.INSTANCE, "iterator");
      if (jsIterator != null) {
        alertSink.add(new UnknownAttributeError(node, jsIterator));
        return null;
      }

      if ((type != null) && (var != null) && !foundConflict) {
        output.accumulate(new LoopExpression(node, type, key, var, iterable, iterator,
View Full Code Here

          if (value instanceof StringConstant) {
            attr = attr.withValue(new ObjectConstant((StringConstant) value));
          }
          attrBuilder.put(attr.getName(), attr);
        } else {
          alertSink.add(new UnknownAttributeError(node, attr));
        }
      }

      TemplateName callee = TemplateName.parseDottedName(alertSink,
                                                         node.getSourcePosition(),
View Full Code Here

        List<Attribute> result = Lists.newArrayList();
        for (Attribute attr : attrs) {
          AttributeValidator attrValidator =
              elementValidator.getAttributeValidator(attr.getName());
          if (attrValidator == null) {
            alertSink.add(new UnknownAttributeError(forNode, attr));
          } else {
            Expression attrValue = attr.getValue();
            if (attrValue instanceof StringConstant) {
              String value = ((StringConstant) attrValue).evaluate();
              if (!attrValidator.isValidValue(value)) {
View Full Code Here

    assertNoUnexpectedAlerts();
  }

  public void testElement_unknownAttribute() throws Exception {
    compile("<div zaphod='hoopy-frood'/>");
    assertAlert(new UnknownAttributeError("<div>", pos(2, 1),
                                          "'zaphod' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    assertNoUnexpectedAlerts();
  }

  public void testShortEval_withExprAttr() throws Exception {
    compile("<expr:x expr='x' />");
    assertAlert(new UnknownAttributeError("<expr:x>", pos(2,1), "'expr' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

TOP

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

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.