Package jodd.lagarto
Interface TagVisitor
-
- All Known Implementing Classes:
EmptyTagVisitor,LagartoDOMBuilderTagVisitor,StripHtmlTagAdapter,TagAdapter,TagVisitors,TagWriter,UrlRewriterTagAdapter
public interface TagVisitorHandler that receives callbacks as content is parsed.- See Also:
TagAdapter,EmptyTagVisitor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcdata(java.lang.CharSequence cdata)Invoked on CDATA sequence.voidcomment(java.lang.CharSequence comment)Invoked on comment.voidcondComment(java.lang.CharSequence expression, boolean isStartingTag, boolean isHidden, boolean isHiddenEndTag)Invoked on IE conditional comment.voiddoctype(Doctype doctype)Invoked on DOCTYPE directive.voidend()Invoked at the end, after all content is visited.voiderror(java.lang.String message)Warn about parsing error.voidscript(Tag tag, java.lang.CharSequence body)Invoked on script tag.voidstart()Invoked on very beginning of the visiting.voidtag(Tag tag)Invoked ontag(open, close or empty).voidtext(java.lang.CharSequence text)Invoked on text i.e.voidxml(java.lang.CharSequence version, java.lang.CharSequence encoding, java.lang.CharSequence standalone)Invoked on xml declaration.
-
-
-
Method Detail
-
start
void start()
Invoked on very beginning of the visiting.
-
end
void end()
Invoked at the end, after all content is visited.
-
doctype
void doctype(Doctype doctype)
Invoked on DOCTYPE directive.
-
tag
void tag(Tag tag)
Invoked ontag(open, close or empty).Warning: the passed tag instance should not be kept beyond this method as the parser reuse it!
-
script
void script(Tag tag, java.lang.CharSequence body)
Invoked on script tag.
-
comment
void comment(java.lang.CharSequence comment)
Invoked on comment.
-
text
void text(java.lang.CharSequence text)
Invoked on text i.e. anything other than a tag.
-
condComment
void condComment(java.lang.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
void xml(java.lang.CharSequence version, java.lang.CharSequence encoding, java.lang.CharSequence standalone)Invoked on xml declaration.
-
cdata
void cdata(java.lang.CharSequence cdata)
Invoked on CDATA sequence.
-
error
void error(java.lang.String message)
Warn about parsing error. Usually, parser will try to continue.- Parameters:
message- parsing error message
-
-