public class XMLStringWriter
extends java.lang.Object
| Constructor and Description |
|---|
XMLStringWriter()
Constructs a new XMLStringWriter with a default indentation length of 4.
|
XMLStringWriter(int indent)
Constructs a new XMLStringWriter that formats elements and attributes
appened to this writer instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(java.lang.String key,
java.lang.String value)
Adds an attributes to the current active Element
|
void |
addDataElement(java.lang.String ele,
java.lang.String text)
Adding an element like this assumes that there are no
attributes to be added to this element
|
void |
addElementTextData(java.lang.String data)
Adds the specified data to the current XML string.
|
void |
appendXMLWriterString(XMLStringWriter writer)
Appends the string constructed by the specified writer to this.
|
void |
beginElement(java.lang.String ele,
boolean hasAttributes)
Adding an element like this or beginning an element tree.
|
void |
beginXMLString(java.lang.String root)
Begings this XML String.
|
void |
endAttributes()
Ends the attributes for the currently active Element
|
void |
endElement(java.lang.String ele)
Ends the specified element
|
void |
endXMLString()
Ends this XML String.
|
java.lang.String |
toString()
Returns XML String representation of what was appended/written on this
|
public XMLStringWriter(int indent)
indent - the size of the indent for this writerpublic XMLStringWriter()
public void appendXMLWriterString(XMLStringWriter writer)
writer - the desired XMLStringWriter to append to thispublic void beginXMLString(java.lang.String root)
root - public void endXMLString()
public void addDataElement(java.lang.String ele,
java.lang.String text)
ele - text - public void beginElement(java.lang.String ele,
boolean hasAttributes)
ele - public void addElementTextData(java.lang.String data)
data - String data to append to the current XML Stringpublic void addAttribute(java.lang.String key,
java.lang.String value)
key - value - public void endAttributes()
public void endElement(java.lang.String ele)
ele - String of elementpublic java.lang.String toString()
toString in class java.lang.Object