Package nl.info.webdav.fromcatalina
Class XMLWriter
java.lang.Object
nl.info.webdav.fromcatalina.XMLWriter
XMLWriter helper class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringBufferBuffer.protected booleanIs true until the root element is writtenNamespaces to be declared in the root elementprotected WriterWriter.static final intClosing tag.static final intElement with no content.static final intOpening tag. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsendData()Send data and re-initialize buffer.toString()Retrieve generated XML.voidWrite data.voidwriteElement(String name, int type) Write an element.voidwriteProperty(String name) Write property to the XML.voidwriteProperty(String name, String value) 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. -
_namespaces
Namespaces to be declared in the root element -
_isRootElement
protected boolean _isRootElementIs true until the root element is written
-
-
Constructor Details
-
XMLWriter
Constructor. -
XMLWriter
Constructor.
-
-
Method Details
-
toString
Retrieve generated XML. -
writeProperty
Write property to the XML.- Parameters:
name- Property namevalue- Property value
-
writeProperty
Write property to the XML.- Parameters:
name- Property name
-
writeElement
Write an element.- Parameters:
name- 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 re-initialize buffer.- Throws:
IOException
-