Class StripHtmlTagAdapter
java.lang.Object
jodd.lagarto.TagAdapter
jodd.lagarto.adapter.StripHtmlTagAdapter
- All Implemented Interfaces:
TagVisitor
Strips all non-important characters from HTML.
Script and style blocks are not stripped, just HTML text blocks
and comments.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final CharSequenceprotected booleanprotected intFields inherited from class TagAdapter
target -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcomment(CharSequence comment) Skips HTML comments.intReturns total number of stripped chars.voidstart()Invoked on very beginning of the visiting.voidInvoked ontag(open, close or empty).voidtext(CharSequence text) Cleans unnecessary whitespaces.Methods inherited from class TagAdapter
cdata, condComment, doctype, end, error, getTarget, script, xml
-
Field Details
-
strippedCharsCount
protected int strippedCharsCount -
strip
protected boolean strip -
PRE
-
-
Constructor Details
-
StripHtmlTagAdapter
-
-
Method Details
-
start
public void start()Description copied from interface:TagVisitorInvoked on very beginning of the visiting.- Specified by:
startin interfaceTagVisitor- Overrides:
startin classTagAdapter
-
comment
Skips HTML comments.- Specified by:
commentin interfaceTagVisitor- Overrides:
commentin classTagAdapter
-
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
Cleans unnecessary whitespaces.- Specified by:
textin interfaceTagVisitor- Overrides:
textin classTagAdapter
-
getStrippedCharsCount
public int getStrippedCharsCount()Returns total number of stripped chars.
-