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

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


                                "</gxp:constructor>",
                                "<gxp:param name='s2' type='String' />");
    FileRef caller = createFile("caller", "<call:callee/>");
    compileFiles(callee, caller);

    assertAlert(new MissingAttributeError(pos(2,1), "<call:callee>", "s1"));
    assertAlert(new MissingAttributeError(pos(2,1), "<call:callee>", "s2"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here


    assertNoUnexpectedAlerts();
  }

  public void testMissingWith() throws Exception {
    compile("<java:annotate />");
    assertAlert(new MissingAttributeError(pos(2,1), "<java:annotate>", "with"));
    assertNoUnexpectedAlerts();
  }
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

      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

                                  Expression fallback,
                                  boolean optional) {
    Attribute attr = getAttribute(ns, name);
    if (attr == null) {
      if (!optional) {
        alertSink.add(new MissingAttributeError(forNode, name));
      }
      return fallback;
    } else {
      return attr.getValue();
    }
View Full Code Here

    }

    MultiLanguageAttrValue mlar = getMultiLanguageAttrValue(name, true);
    if (mlar.isEmpty()) {
      if (!optional) {
        alertSink.add(new MissingAttributeError(forNode, name));
      }
      return fallback;
    }
    return new NativeExpression(forNode.getSourcePosition(), "'" + name + "' attribute", mlar);
  }
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

    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

                                "<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

  public void testCall_requiredParamMissing() throws Exception {
    String endCall = "</my:" + getTemplateBaseName() + ">";
    compile("<gxp:param type='String' name='s'/>",
            "<my:" + getTemplateBaseName() + "/>");
    assertAlert(new MissingAttributeError(pos(3, 1),
                                          "<my:" + getTemplateBaseName() + ">",
                                          "s"));
    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.