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 StringBuffer
Buffer.static final int
Closing tag.static final int
Element with no content.static final int
Opening tag.protected Writer
Writer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
sendData()
Send data and reinitializes buffer.toString()
Retrieve generated XML.void
Write data.void
writeElement
(String namespace, String name, int type) Write an element.void
writeElement
(String namespace, String namespaceInfo, String name, int type) Write an element.void
writeProperty
(String namespace, String name) Write property to the XML.void
writeProperty
(String namespace, String name, String value) Write property to the XML.void
writeProperty
(String namespace, String namespaceInfo, String name, String value) Write property to the XML.void
writeProperty
(String namespace, String namespaceInfo, String name, String value, boolean cdata) Write property to the XML.void
Write text.void
Write 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
-