Package jodd.lagarto.adapter
Class StripHtmlTagAdapter
- java.lang.Object
-
- jodd.lagarto.TagAdapter
-
- 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
Fields Modifier and Type Field Description protected booleanstripprotected intstrippedCharsCount-
Fields inherited from class jodd.lagarto.TagAdapter
target
-
-
Constructor Summary
Constructors Constructor Description StripHtmlTagAdapter(TagVisitor target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomment(java.lang.CharSequence comment)Skips HTML comments.intgetStrippedCharsCount()Returns total number of stripped chars.voidstart()Invoked on very beginning of the visiting.voidtag(Tag tag)Invoked ontag(open, close or empty).voidtext(java.lang.CharSequence text)Cleans unnecessary whitespaces.-
Methods inherited from class jodd.lagarto.TagAdapter
cdata, condComment, doctype, end, error, getTarget, script, xml
-
-
-
-
Constructor Detail
-
StripHtmlTagAdapter
public StripHtmlTagAdapter(TagVisitor target)
-
-
Method Detail
-
start
public void start()
Description copied from interface:TagVisitorInvoked on very beginning of the visiting.- Specified by:
startin interfaceTagVisitor- Overrides:
startin classTagAdapter
-
comment
public void comment(java.lang.CharSequence comment)
Skips HTML comments.- Specified by:
commentin interfaceTagVisitor- Overrides:
commentin classTagAdapter
-
tag
public void tag(Tag tag)
Description copied from interface:TagVisitorInvoked ontag(open, close or empty).Warning: the passed tag instance should not be kept beyond this method as the parser reuse it!
- Specified by:
tagin interfaceTagVisitor- Overrides:
tagin classTagAdapter
-
text
public void text(java.lang.CharSequence text)
Cleans unnecessary whitespaces.- Specified by:
textin interfaceTagVisitor- Overrides:
textin classTagAdapter
-
getStrippedCharsCount
public int getStrippedCharsCount()
Returns total number of stripped chars.
-
-