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

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


    FileRef callee = createFile("callee",
                                "<gxp:param name='bundle' gxp:type='bundle' from-element='img'/>");
    FileRef caller = createFile("caller",
                                "<call:callee />");
    compileFiles(callee, caller);
    assertAlert(new MissingAttributeError(pos(2, 1), "<call:callee>", "alt"));
    assertNoUnexpectedAlerts();

    // required attributes can't be conditional
    caller = createFile("caller",
                        "<call:callee>",
View Full Code Here


                                                        int errorColumn)
      throws Exception {

    // missing attribute
    compile(String.format("%s %s", prefix, suffix));
    assertAlert(new MissingAttributeError(pos(errorLine, errorColumn), element, attrName));
    assertNoUnexpectedAlerts();

    // basic attribute
    compile(String.format("%s %s='e' %s", prefix, attrName, suffix));
    assertNoUnexpectedAlerts();
View Full Code Here

      // check to make sure that there are no remaining allowed attributes
      // that are required.
      for (Map.Entry<String, AttributeValidator> entry : validatorMap.entrySet()) {
        if (entry.getValue().isFlagSet(AttributeValidator.Flag.REQUIRED)
            && !foundAttributes.contains(entry.getKey())) {
          alertSink.add(new MissingAttributeError(node, entry.getKey()));
        }
      }
    }
View Full Code Here

      // check for missing required attributes
      for (FormalParameter parameter : callee.getParameters()) {
        if (!parameter.hasDefault()) {
          if (!newAttrParams.containsKey(parameter.getPrimaryName())) {
            alertSink.add(new MissingAttributeError(call, parameter.getPrimaryName()));
          } else {
            Attribute fpAttribute = call.getAttributes().get(parameter.getPrimaryName());
            if (fpAttribute != null && fpAttribute.getCondition() != null) {
              alertSink.add(new RequiredAttributeHasCondError(call, fpAttribute));
            }
View Full Code Here

      AttributeMap attrMap = nodeParts.getAttributes();
      MultiLanguageAttrValue expr = attrMap.getMultiLanguageAttrValue("expr", true);
      String example = attrMap.getOptional("example", null);
      String phName = attrMap.getOptional(GxpNamespace.INSTANCE, "ph", null);
      if (expr.isEmpty()) {
        alertSink.add(new MissingAttributeError(node, "expr"));
      } else {
        output.accumulate(new NativeExpression(node, expr, example, phName));
      }
      return null;
    }
View Full Code Here

    FileRef iface = createInterfaceFile("testInterface");
    FileRef implementation = createFile("testImplementation",
                                        "<call:testInterface />");

    compileFiles(iface, implementation);
    assertAlert(new MissingAttributeError(pos(2,1), "<call:testInterface>", "this"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

      Iterator<Conditional.Clause> iter = clauses.iterator();
      while (iter.hasNext()) {
        Conditional.Clause clause = iter.next();
        if (clause.getPredicate().alwaysEquals(true)
            && (clauses.size() == 1 || iter.hasNext() == true)) {
          alertSink.add(new MissingAttributeError(clause, "cond"));
        }
      }

      if (!clauses.isEmpty()) {
        Conditional.Clause lastClause = clauses.get(clauses.size() - 1);
View Full Code Here

    assertNoUnexpectedAlerts();
  }

  public void testElement_requiredAttributeMissing() throws Exception {
    compile("<img src='foo.gif'/>");
    assertAlert(new MissingAttributeError(pos(2,1), "<img>", "alt"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

        "<gxp:abbr name='foo' type='", "' expr='1'></gxp:abbr>");
  }

  public void testAbbr_missingExpr() throws Exception {
    compile("<gxp:abbr name='fred' type='Flintstone'/>");
    assertAlert(new MissingAttributeError(pos(2, 1), "<gxp:abbr>", "expr"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

                                "<call:callee>foo</call:callee>",
                                "<my:callee>foo</my:callee>");
    compileFiles(callee, caller);
    assertAlert(new BadNodePlacementError(pos(2, 14), "text",
                                          "inside <call:callee>"));
    assertAlert(new MissingAttributeError(pos(2, 1), "<call:callee>", "x"));
    assertAlert(new BadNodePlacementError(pos(3, 12), "text",
                                          "inside <my:callee>"));
    assertAlert(new MissingAttributeError(pos(3, 1), "<my:callee>", "x"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

TOP

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

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.