java.lang.Object | ||
↳ | com.pnfsoftware.jeb.util.format.TextBuilder | |
↳ | com.pnfsoftware.jeb.util.format.XmlBuilder |
A specialized text builder used to craft XML documents sequentially.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
XmlBuilder() | |||||||||||
XmlBuilder(int indentationSize) | |||||||||||
XmlBuilder(int indentationSize, int initialCapacity) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
appendHeader(int versionMajor, int versionMinor, String encoding, boolean standalone)
Append an XML header.
| ||||||||||
void |
appendStandardHeader()
Append a standard 1.0 header specifying a UTF-8 encoding and standalone=no.
| ||||||||||
void |
closeElement()
Close the last opened element.
| ||||||||||
void |
closeElement(boolean appendLine)
Close the last opened element.
| ||||||||||
static CharSequence | escapeAll(CharSequence s) | ||||||||||
static CharSequence |
escapeAttributeData(CharSequence s)
Escape an XML attribute data string.
| ||||||||||
static CharSequence |
escapeTextData(CharSequence s)
Escape an XML text data string.
| ||||||||||
void |
openElement(String name)
Output an XML element with attributes.
| ||||||||||
void |
openElement(String name, Map<String, String> attributes)
Output an XML element with attributes.
| ||||||||||
void |
openElement(String name, Map<String, String> attributes, boolean close)
Output an XML element with attributes.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.pnfsoftware.jeb.util.format.TextBuilder
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Appendable
|
Append an XML header.
Append a standard 1.0 header specifying a UTF-8 encoding and standalone=no.
Close the last opened element.
Close the last opened element.
appendLine | if true, a new line is appended after the closing tag |
---|
Escape an XML attribute data string.
Escape an XML text data string.
Output an XML element with attributes. The element is not not output
Output an XML element with attributes. The closing tag is not output.
attributes | optional attributes |
---|
Output an XML element with attributes.
name | the element name |
---|---|
attributes | optional map of attributes name->value, which must be escaped (this method will append the attributes' names and values as-is) |
close | if true, the tag is immediately closed using "/>" |