Examples of Concatenator


Examples of com.google.caja.render.Concatenator

          throw new GadgetRewriteException("Gadget has compile errors");
        }
        StringBuilder scriptBody = new StringBuilder();
        CajoledModule cajoled = compiler.getJavascript();
        TokenConsumer tc = debug
            ? new JsPrettyPrinter(new Concatenator(scriptBody))
            : new JsMinimalPrinter(new Concatenator(scriptBody));
        cajoled.render(new RenderContext(tc)
          .withAsciiOnly(true)
          .withEmbeddable(true));

        tc.noMoreTokens();
View Full Code Here

Examples of com.google.caja.render.Concatenator

* @since 2.0.0
*/
public class CajaHtmlSerializer implements HtmlSerializer {
  public String serialize(Document doc) {
    StringWriter sw = HtmlSerialization.createWriter(doc);
    return Nodes.render(doc, new RenderContext(new Concatenator(sw, null)).asXml());
  }
View Full Code Here

Examples of com.google.caja.render.Concatenator

    return CajaCssUtils.restoreIp6Uris(writer.toString(), ip6Uris);
  }

  /** Serialize a stylesheet to a Writer. */
  public void serialize(CssTree.StyleSheet styleSheet, Writer writer) {
    CssPrettyPrinter cssPrinter = new CssPrettyPrinter(new Concatenator(writer, null));
    styleSheet.render(new RenderContext(cssPrinter));
    cssPrinter.noMoreTokens();
  }
View Full Code Here

Examples of com.google.caja.render.Concatenator

      CajoledModule outputJs = passed ? compiler.getJavascript() : null;

      StringBuilder jsOut = new StringBuilder();
      TokenConsumer printer;
      if ("1".equals(req.getParam("debug"))) {
        printer = new JsPrettyPrinter(new Concatenator(jsOut));
      } else {
        printer = new JsMinimalPrinter(new Concatenator(jsOut));
      }

      RenderContext renderContext = new RenderContext(printer).withEmbeddable(true);

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

Examples of com.google.caja.render.Concatenator

  @Override
  public DocumentFragment getValue() { return fragment; }

  public TokenConsumer makeRenderer(
      Appendable out, Callback<IOException> handler) {
    return new Concatenator(out, handler);
  }
View Full Code Here

Examples of com.google.caja.render.Concatenator

                    "html", renderDomAsJsStringLiteral(node)))))));
  }

  private static StringLiteral renderDomAsJsStringLiteral(Node node) {
    StringBuilder stringBuilder = new StringBuilder();
    TokenConsumer tc = new Concatenator(stringBuilder);
    Nodes.render(node, new RenderContext(tc));
    return StringLiteral.valueOf(Nodes.getFilePositionFor(node), stringBuilder);
  }
View Full Code Here

Examples of com.google.caja.render.Concatenator

          throw new GadgetRewriteException("Gadget has compile errors");
        }
        StringBuilder scriptBody = new StringBuilder();
        CajoledModule cajoled = compiler.getJavascript();
        TokenConsumer tc = debug
            ? new JsPrettyPrinter(new Concatenator(scriptBody))
            : new JsMinimalPrinter(new Concatenator(scriptBody));
        cajoled.render(new RenderContext(tc)
          .withAsciiOnly(true)
          .withEmbeddable(true));

        tc.noMoreTokens();
View Full Code Here

Examples of com.google.caja.render.Concatenator

  private static RenderContext makeRenderContext(
      Appendable a, IOCallback cb,
      boolean pretty,
      boolean json) {
    TokenConsumer tc = pretty
        ? new JsPrettyPrinter(new Concatenator(a, cb))
        : new JsMinimalPrinter(new Concatenator(a, cb));
    return new RenderContext(tc).withJson(json);
  }
View Full Code Here

Examples of com.google.caja.render.Concatenator

    return sb.toString();
  }

  public final TokenConsumer makeRenderer(
      Appendable out, Callback<IOException> exHandler) {
    return new CssPrettyPrinter(new Concatenator(out, exHandler));
  }
View Full Code Here

Examples of com.google.caja.render.Concatenator

    StringBuilder filteredXhtml = new StringBuilder();
    if (message.getFirstChild() != null) {
      // Render an XHTML string containing the message content, with embedded
      // <ph> elements.
      StringBuilder xhtml = new StringBuilder();
      RenderContext rc = new RenderContext(new Concatenator(xhtml))
          .withMarkupRenderMode(MarkupRenderMode.XML);
      for (Node c : Nodes.childrenOf(message)) {
        Nodes.render(c, rc);
      }
      rc.getOut().noMoreTokens();
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.