Package jodd.lagarto

Examples of jodd.lagarto.TagWriter


      // create Lagarto
      lagartoParser = new LagartoParser(content, emitStrings);

      // prepare root tag writer
      fastCharArrayWriter = new FastCharArrayWriter();
      tagWriter = new TagWriter(fastCharArrayWriter);
    }
View Full Code Here


  public void testStripHtml() {
    LagartoParser lagartoParser = new LagartoParser(
        "<html>  <div   id='a'>   x \n\n\n </div>  </html>", false);

    StringBuilder out = new StringBuilder();
    StripHtmlTagAdapter stripHtmlTagAdapter = new StripHtmlTagAdapter(new TagWriter(out));

    lagartoParser.parse(stripHtmlTagAdapter);

    assertEquals("<html><div id=\"a\"> x </div></html>", out.toString());
  }
View Full Code Here

  public void testUrlRewriter() {
    LagartoParser lagartoParser = new LagartoParser(
        "<a href=\"http://jodd.org\">1</a><a href=\"page.html\">2</a>", false);

    StringBuilder out = new StringBuilder();
    UrlRewriterTagAdapter urlRewriterTagAdapter = new UrlRewriterTagAdapter(new TagWriter(out)) {

      @Override
      protected CharSequence rewriteUrl(CharSequence url) {
        String u = url.toString();
        if (u.startsWith("http")) {
View Full Code Here

TOP

Related Classes of jodd.lagarto.TagWriter

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.