jodd.lagarto.adapter
Class StripHtmlTagAdapter

java.lang.Object
  extended by jodd.lagarto.TagAdapter
      extended by jodd.lagarto.adapter.StripHtmlTagAdapter
All Implemented Interfaces:
TagVisitor

public class StripHtmlTagAdapter
extends TagAdapter

Strips all non-important characters from HTML. Script and style blocks are not stripped, just HTML text blocks and comments.


Field Summary
protected  int strippedCharsCount
           
 
Fields inherited from class jodd.lagarto.TagAdapter
target
 
Constructor Summary
StripHtmlTagAdapter(TagVisitor target)
           
 
Method Summary
 void comment(java.lang.CharSequence comment)
          Skips HTML comments.
 int getStrippedCharsCount()
          Returns total number of stripped chars.
 void start()
          Invoked on very beginning of the visiting.
 void text(java.lang.CharSequence text)
          Cleans unnecessary whitespaces.
 
Methods inherited from class jodd.lagarto.TagAdapter
cdata, condComment, doctype, end, error, getTarget, script, style, tag, xml, xmp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

strippedCharsCount

protected int strippedCharsCount
Constructor Detail

StripHtmlTagAdapter

public StripHtmlTagAdapter(TagVisitor target)
Method Detail

start

public void start()
Description copied from interface: TagVisitor
Invoked on very beginning of the visiting.

Specified by:
start in interface TagVisitor
Overrides:
start in class TagAdapter

comment

public void comment(java.lang.CharSequence comment)
Skips HTML comments.

Specified by:
comment in interface TagVisitor
Overrides:
comment in class TagAdapter

text

public void text(java.lang.CharSequence text)
Cleans unnecessary whitespaces.

Specified by:
text in interface TagVisitor
Overrides:
text in class TagAdapter

getStrippedCharsCount

public int getStrippedCharsCount()
Returns total number of stripped chars.



Copyright © 2003-2012 Jodd Team