Package org.apache.jorphan.util
Class XMLBuffer
java.lang.Object
org.apache.jorphan.util.XMLBuffer
Provides XML string building methods.
Not synchronised.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionClose top tag from stack.Open a tag; save on stack.tag
(String tagName, CharSequence content) Add a complete tag with content.toString()
Convert the buffer to a string, closing any open tags
-
Constructor Details
-
XMLBuffer
public XMLBuffer()
-
-
Method Details
-
openTag
Open a tag; save on stack.- Parameters:
tagName
- name of the tag- Returns:
- this
-
closeTag
Close top tag from stack.- Parameters:
tagName
- name of the tag to close- Returns:
- this
- Throws:
IllegalArgumentException
- if the tag names do not match
-
tag
Add a complete tag with content.- Parameters:
tagName
- name of the tagcontent
- content to put in tag, or empty content, if an empty tag should be used- Returns:
- this
-
toString
Convert the buffer to a string, closing any open tags
-