Package com.google.caja.parser

Examples of com.google.caja.parser.ParseTreeNode.render()


                }
              }
            } else {
              StringBuilder rendered = new StringBuilder();
              TokenConsumer tc = new CssPrettyPrinter(rendered);
              node.render(new RenderContext(tc));
              tc.noMoreTokens();
              mq.addMessage(PluginMessageType.UNSAFE_CSS_PSEUDO_SELECTOR,
                            invalidNodeMessageLevel, node.getFilePosition(),
                            MessagePart.Factory.valueOf(rendered.toString()));
              remove = true;
View Full Code Here


        + "  return @cssSchema;"
        + "})();",
        "poolDecls", poolDecls,
        "cssSchema", cssSchema);
    TokenConsumer tc = js.makeRenderer(out, null);
    js.render(new RenderContext(tc));
    tc.noMoreTokens();
    out.append(";\n");
  }

  private static Expression makeRegexp(
View Full Code Here

  private void renderParam(int i, RenderContext rc) {
    TokenConsumer out = rc.getOut();
    ParseTreeNode e = children().get(i);
    out.mark(e.getFilePosition());
    if (!parenthesize(op, 0 == i, (Expression) e)) {
      e.render(rc);
    } else {
      out.consume("(");
      e.render(rc);
      out.mark(FilePosition.endOfOrNull(getFilePosition()));
      out.consume(")");
View Full Code Here

    out.mark(e.getFilePosition());
    if (!parenthesize(op, 0 == i, (Expression) e)) {
      e.render(rc);
    } else {
      out.consume("(");
      e.render(rc);
      out.mark(FilePosition.endOfOrNull(getFilePosition()));
      out.consume(")");
    }
  }
View Full Code Here

    TokenConsumer renderer = new JsPrettyPrinter(jsOut);
    RenderContext rc = new RenderContext(renderer);
    String htmlOut = outputHtml != null ? Nodes.render(outputHtml) : null;

    if (outputJs != null) {
      outputJs.render(rc);
      rc.getOut().noMoreTokens();
      return new CajolingServiceResult(htmlOut, jsOut.toString(), messages);
    } else {
      return new CajolingServiceResult(htmlOut, null, messages);
    }
View Full Code Here

    List<JobStub> actualJobs = Lists.newArrayList();
    for (JobEnvelope env : jobs.getJobs()) {
      StringBuilder sb = new StringBuilder();
      ParseTreeNode node = env.job.getRoot();
      TokenConsumer tc = node.makeRenderer(sb, null);
      node.render(new RenderContext(tc));
      tc.noMoreTokens();
      actualJobs.add(new JobStub(sb.toString(), env.job.getType()));
    }
    // HACK DEBUG
    if (!Arrays.asList(outputJobs).equals(actualJobs)) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.