Package jodd.lagarto.visitor
Class TagWriter
- java.lang.Object
-
- jodd.lagarto.visitor.TagWriter
-
- All Implemented Interfaces:
TagVisitor
public class TagWriter extends java.lang.Object implements TagVisitor
Tag writer outputs content to anAppendable.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Appendableappendable
-
Method Summary
All Methods Instance Methods Concrete 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.java.lang.AppendablegetOutput()Returns the content.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
-
getOutput
public java.lang.Appendable getOutput()
Returns the content.
-
start
public void start()
Description copied from interface:TagVisitorInvoked on very beginning of the visiting.- Specified by:
startin interfaceTagVisitor
-
end
public void end()
Description copied from interface:TagVisitorInvoked at the end, after all content is visited.- Specified by:
endin interfaceTagVisitor
-
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
-
script
public void script(Tag tag, java.lang.CharSequence body)
Description copied from interface:TagVisitorInvoked on script tag.- Specified by:
scriptin interfaceTagVisitor
-
comment
public void comment(java.lang.CharSequence comment)
Description copied from interface:TagVisitorInvoked on comment.- Specified by:
commentin interfaceTagVisitor
-
text
public void text(java.lang.CharSequence text)
Description copied from interface:TagVisitorInvoked on text i.e. anything other than a tag.- Specified by:
textin interfaceTagVisitor
-
cdata
public void cdata(java.lang.CharSequence cdata)
Description copied from interface:TagVisitorInvoked on CDATA sequence.- Specified by:
cdatain interfaceTagVisitor
-
xml
public void xml(java.lang.CharSequence version, java.lang.CharSequence encoding, java.lang.CharSequence standalone)Description copied from interface:TagVisitorInvoked on xml declaration.- Specified by:
xmlin interfaceTagVisitor
-
doctype
public void doctype(Doctype doctype)
Description copied from interface:TagVisitorInvoked on DOCTYPE directive.- Specified by:
doctypein interfaceTagVisitor
-
condComment
public void condComment(java.lang.CharSequence expression, boolean isStartingTag, boolean isHidden, boolean isHiddenEndTag)Description copied from interface:TagVisitorInvoked 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]>- Specified by:
condCommentin interfaceTagVisitor
-
error
public void error(java.lang.String message)
Description copied from interface:TagVisitorWarn about parsing error. Usually, parser will try to continue.- Specified by:
errorin interfaceTagVisitor- Parameters:
message- parsing error message
-
-