public class XMLStringBuilder extends Object
Constructor and Description |
---|
XMLStringBuilder() |
Modifier and Type | Method and Description |
---|---|
static void |
addAttribute(String name,
String value,
StringBuffer sb,
boolean finishTag)
Add an XML node attribute
|
static void |
addCDataSection(String cdata,
StringBuffer sb)
Add a CDATA section with the given content
|
static void |
addTextNode(String name,
String text,
boolean isCData,
StringBuffer sb)
Add a text node with the given text value
|
static void |
closeCDataSection(StringBuffer sb)
Close the CDATA section
|
static void |
closeTag(String name,
StringBuffer sb)
Close an element tag
|
static void |
openCDataSection(StringBuffer sb)
Open the CDATA section
|
static void |
openCloseTag(String name,
StringBuffer sb)
Draw an empty tag
|
static void |
openTag(String name,
StringBuffer sb,
boolean keepOpenForAttrs)
Draw an element tag
|
public static void openCDataSection(StringBuffer sb)
sb
- the XML bufferpublic static void closeCDataSection(StringBuffer sb)
sb
- the XML Bufferpublic static void addCDataSection(String cdata, StringBuffer sb)
cdata
- the CDATA contentsb
- the XML Bufferpublic static void addTextNode(String name, String text, boolean isCData, StringBuffer sb)
name
- the name of the nodetext
- the text for the nodeisCData
- if true, the text is wrapped in a CDATA sectionsb
- the XML bufferpublic static void addAttribute(String name, String value, StringBuffer sb, boolean finishTag)
name
- the attribute namevalue
- the attribute valuesb
- the XML bufferfinishTag
- if true the tag is closed, false to leave openpublic static void openCloseTag(String name, StringBuffer sb)
name
- the tag namesb
- the XML bufferpublic static void openTag(String name, StringBuffer sb, boolean keepOpenForAttrs)
name
- the element namesb
- the XML bufferkeepOpenForAttrs
- if true, the element will be left open for attributespublic static void closeTag(String name, StringBuffer sb)
name
- the element namesb
- the XML buffer