public class XmlBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Stack<java.lang.String> |
m_openElements |
Constructor and Description |
---|
XmlBuilder()
Constructor.
|
XmlBuilder(boolean autoPad)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
closeTag()
Closes an open tag.
|
java.lang.String |
getXML()
Get the xml.
|
void |
openTag(java.lang.String name)
Writes an opening tag
|
void |
openTag(java.lang.String name,
java.util.HashMap<java.lang.Object,java.lang.String> attributes)
Writes an opening tag with attributes.
|
void |
openTag(java.lang.String name,
java.lang.String attrName,
java.lang.String attrValue)
Writes an opening tag with one attribute.
|
void |
openTag(java.lang.String name,
java.lang.String attr1Name,
java.lang.String attr1Value,
java.lang.String attr2Name,
java.lang.String attr2Value)
Writes an opening tag with two attributes.
|
void |
reset()
Reset this XmlBuilder.
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding used in the XML.
|
void |
writeComment(java.lang.String comment)
Adds a comment to the xml.
|
void |
writeHeader()
Writes the XML document header.
|
void |
writeRaw(java.lang.String raw)
Adds raw data to the xml.
|
void |
writeTag(java.lang.String name,
java.util.HashMap<java.lang.Object,java.lang.String> attributes)
Adds a opening and closing tag with attributes.
|
void |
writeTag(java.lang.String name,
java.lang.String data)
Adds a opening and closing tag with charcter data.
|
void |
writeTag(java.lang.String name,
java.lang.String data,
java.util.HashMap<java.lang.Object,java.lang.String> attributes)
Adds a opening and closing tag with attributes and character data.
|
void |
writeTag(java.lang.String name,
java.lang.String data,
java.lang.String attrName,
java.lang.String attrValue)
Adds a opening and closing tag with an attribute and character data.
|
void |
writeTag(java.lang.String name,
java.lang.String attr1Name,
java.lang.String attr1Value,
java.lang.String attr2Name,
java.lang.String attr2Value)
Adds a opening and closing tag with an attribute and character data.
|
void |
writeTag(java.lang.String name,
java.lang.String data,
java.lang.String attr1Name,
java.lang.String attr1Value,
java.lang.String attr2Name,
java.lang.String attr2Value)
Adds a opening and closing tag with two attributes and character data.
|
public XmlBuilder()
public XmlBuilder(boolean autoPad)
autoPad
- if set, the XML document to be generated will
automatically be indented.public void reset()
public void writeRaw(java.lang.String raw)
public void writeComment(java.lang.String comment)
public void writeHeader()
public void setEncoding(java.lang.String encoding)
encoding
- public void writeTag(java.lang.String name, java.lang.String data)
public void writeTag(java.lang.String name, java.util.HashMap<java.lang.Object,java.lang.String> attributes)
public void writeTag(java.lang.String name, java.lang.String attr1Name, java.lang.String attr1Value, java.lang.String attr2Name, java.lang.String attr2Value)
public void writeTag(java.lang.String name, java.lang.String data, java.lang.String attrName, java.lang.String attrValue)
public void writeTag(java.lang.String name, java.lang.String data, java.lang.String attr1Name, java.lang.String attr1Value, java.lang.String attr2Name, java.lang.String attr2Value)
public void writeTag(java.lang.String name, java.lang.String data, java.util.HashMap<java.lang.Object,java.lang.String> attributes)
public void openTag(java.lang.String name)
public void openTag(java.lang.String name, java.lang.String attrName, java.lang.String attrValue)
public void openTag(java.lang.String name, java.lang.String attr1Name, java.lang.String attr1Value, java.lang.String attr2Name, java.lang.String attr2Value)
public void openTag(java.lang.String name, java.util.HashMap<java.lang.Object,java.lang.String> attributes)
public void closeTag()
public java.lang.String getXML()