Package com.google.caja.lexer

Examples of com.google.caja.lexer.CharProducer.clone()


    CharProducer testInput = fromResource("amazon.com.html");
    InputSource is = testInput.getSourceBreaks(0).source();
    MessageQueue mq = DevNullMessageQueue.singleton();
    long t0 = System.nanoTime();
    for (int i = nRuns; --i >= 0;) {
      HtmlLexer lexer = new HtmlLexer(testInput.clone());
      lexer.setTreatedAsXml(false);
      TokenQueue<HtmlTokenType> tq = new TokenQueue<HtmlTokenType>(
          lexer, is, DomParser.SKIP_COMMENTS);
      DomParser p = new DomParser(tq, false, mq);
      p.setNeedsDebugData(false);
View Full Code Here


      Element el, ContentType t, EmbeddedContent.Scheduling scheduling) {
    final CharProducer cp = textNodesToCharProducer(el, t == ContentType.JS);
    return new EmbeddedContent(
        this, cp.filePositionForOffsets(0, cp.getLimit()),
        new Function<UriFetcher, CharProducer>() {
          public CharProducer apply(UriFetcher fetcher) { return cp.clone(); }
        },
        null, scheduling, el, t);
  }

  private EmbeddedContent fromAttrib(final Attr a, final boolean uriDecode,
View Full Code Here

    CharProducer testInput = fromResource("amazon.com.html");
    InputSource is = testInput.getSourceBreaks(0).source();
    MessageQueue mq = DevNullMessageQueue.singleton();
    long t0 = System.nanoTime();
    for (int i = nRuns; --i >= 0;) {
      HtmlLexer lexer = new HtmlLexer(testInput.clone());
      lexer.setTreatedAsXml(false);
      TokenQueue<HtmlTokenType> tq = new TokenQueue<HtmlTokenType>(
          lexer, is, DomParser.SKIP_COMMENTS);
      DomParser p = new DomParser(tq, false, mq);
      p.setNeedsDebugData(false);
View Full Code Here

      Element el, ContentType t, boolean deferred) {
    final CharProducer cp = textNodesToCharProducer(el, t == ContentType.JS);
    return new EmbeddedContent(
        this, cp.filePositionForOffsets(0, cp.getLimit()),
        new Function<UriFetcher, CharProducer>() {
          public CharProducer apply(UriFetcher fetcher) { return cp.clone(); }
        },
        null, deferred, el, t);
  }

  private EmbeddedContent fromAttrib(final Attr a, final boolean uriDecode,
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.