Interface TagVisitor
- All Known Implementing Classes:
EmptyTagVisitor, LagartoDOMBuilderTagVisitor, StripHtmlTagAdapter, TagAdapter, TagVisitors, TagWriter, UrlRewriterTagAdapter
public interface TagVisitor
Handler that receives callbacks as content is parsed.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidcdata(CharSequence cdata) Invoked on CDATA sequence.voidcomment(CharSequence comment) Invoked on comment.voidcondComment(CharSequence expression, boolean isStartingTag, boolean isHidden, boolean isHiddenEndTag) Invoked on IE conditional comment.voidInvoked on DOCTYPE directive.voidend()Invoked at the end, after all content is visited.voidWarn about parsing error.voidscript(Tag tag, CharSequence body) Invoked on script tag.voidstart()Invoked on very beginning of the visiting.voidInvoked ontag(open, close or empty).voidtext(CharSequence text) Invoked on text i.e.voidxml(CharSequence version, CharSequence encoding, CharSequence standalone) Invoked on xml declaration.
-
Method Details
-
start
void start()Invoked on very beginning of the visiting. -
end
void end()Invoked at the end, after all content is visited. -
doctype
Invoked on DOCTYPE directive. -
tag
-
script
Invoked on script tag. -
comment
Invoked on comment. -
text
Invoked on text i.e. anything other than a tag. -
condComment
void condComment(CharSequence expression, boolean isStartingTag, boolean isHidden, boolean isHiddenEndTag) Invoked on IE conditional comment. By default, the parser does not process the conditional comments, so you need to turn them on. Once conditional comments are enabled, this even will be fired.The following conditional comments are recognized:
<!--[if IE 6]>one<![endif]--> <!--[if IE 6]><!-->two<!---<![endif]--> <!--[if IE 6]>three<!--xx<![endif]--> <![if IE 6]>four<![endif]> -
xml
Invoked on xml declaration. -
cdata
Invoked on CDATA sequence. -
error
Warn about parsing error. Usually, parser will try to continue.- Parameters:
message- parsing error message
-