Methods Summary |
---|
public void | sendData()Send data and reinitializes buffer.
if (writer != null) {
writer.write(buffer.toString());
buffer = new StringBuffer();
}
|
public java.lang.String | toString()Retrieve generated XML.
return buffer.toString();
|
public void | writeData(java.lang.String data)Write data.
buffer.append("<![CDATA[" + data + "]]>");
|
public void | writeElement(java.lang.String namespace, java.lang.String name, int type)Write an element.
writeElement(namespace, null, name, type);
|
public void | writeElement(java.lang.String namespace, java.lang.String namespaceInfo, java.lang.String name, int type)Write an element.
if ((namespace != null) && (namespace.length() > 0)) {
switch (type) {
case OPENING:
if (namespaceInfo != null) {
buffer.append("<" + namespace + ":" + name + " xmlns:"
+ namespace + "=\""
+ namespaceInfo + "\">");
} else {
buffer.append("<" + namespace + ":" + name + ">");
}
break;
case CLOSING:
buffer.append("</" + namespace + ":" + name + ">\n");
break;
case NO_CONTENT:
default:
if (namespaceInfo != null) {
buffer.append("<" + namespace + ":" + name + " xmlns:"
+ namespace + "=\""
+ namespaceInfo + "\"/>");
} else {
buffer.append("<" + namespace + ":" + name + "/>");
}
break;
}
} else {
switch (type) {
case OPENING:
buffer.append("<" + name + ">");
break;
case CLOSING:
buffer.append("</" + name + ">\n");
break;
case NO_CONTENT:
default:
buffer.append("<" + name + "/>");
break;
}
}
|
public void | writeProperty(java.lang.String namespace, java.lang.String namespaceInfo, java.lang.String name, java.lang.String value)Write property to the XML.
writeElement(namespace, namespaceInfo, name, OPENING);
buffer.append(value);
writeElement(namespace, namespaceInfo, name, CLOSING);
|
public void | writeProperty(java.lang.String namespace, java.lang.String name, java.lang.String value)Write property to the XML.
writeElement(namespace, name, OPENING);
buffer.append(value);
writeElement(namespace, name, CLOSING);
|
public void | writeProperty(java.lang.String namespace, java.lang.String name)Write property to the XML.
writeElement(namespace, name, NO_CONTENT);
|
public void | writeText(java.lang.String text)Write text.
buffer.append(text);
|
public void | writeXMLHeader()Write XML Header.
buffer.append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n");
|