Package org.apache.webdav.lib.util
Class XMLPrinter
java.lang.Object
org.apache.webdav.lib.util.XMLPrinter
XMLPrinter helper class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringBufferBuffer.static final intClosing tag.static final intElement with no content.static final intOpening tag.protected WriterWriter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsendData()Send data and reinitializes buffer.toString()Retrieve generated XML.voidWrite data.voidwriteElement(String namespace, String name, int type) Write an element.voidwriteElement(String namespace, String namespaceInfo, String name, int type) Write an element.voidwriteProperty(String namespace, String name) Write property to the XML.voidwriteProperty(String namespace, String name, String value) Write property to the XML.voidwriteProperty(String namespace, String namespaceInfo, String name, String value) Write property to the XML.voidwriteProperty(String namespace, String namespaceInfo, String name, String value, boolean cdata) Write property to the XML.voidWrite text.voidWrite XML Header.
-
Field Details
-
OPENING
public static final int OPENINGOpening tag.- See Also:
-
CLOSING
public static final int CLOSINGClosing tag.- See Also:
-
NO_CONTENT
public static final int NO_CONTENTElement with no content.- See Also:
-
buffer
Buffer. -
writer
Writer.
-
-
Constructor Details
-
XMLPrinter
public XMLPrinter()Constructor. -
XMLPrinter
Constructor.
-
-
Method Details
-
toString
Retrieve generated XML. -
writeProperty
public void writeProperty(String namespace, String namespaceInfo, String name, String value, boolean cdata) Write property to the XML.- Parameters:
namespace- NamespacenamespaceInfo- Namespace infoname- Property namevalue- Property value
-
writeProperty
Write property to the XML.- Parameters:
namespace- NamespacenamespaceInfo- Namespace infoname- Property namevalue- Property value
-
writeProperty
Write property to the XML.- Parameters:
namespace- Namespacename- Property namevalue- Property value
-
writeProperty
Write property to the XML.- Parameters:
namespace- Namespacename- Property name
-
writeElement
Write an element.- Parameters:
namespace- Namespace abbreviationname- Element nametype- Element type
-
writeElement
Write an element.- Parameters:
namespace- Namespace abbreviationnamespaceInfo- Namespace infoname- Element nametype- Element type
-
writeText
Write text.- Parameters:
text- Text to append
-
writeData
Write data.- Parameters:
data- Data to append
-
writeXMLHeader
public void writeXMLHeader()Write XML Header. -
sendData
Send data and reinitializes buffer.- Throws:
IOException
-