org.jrobin.core

Class XmlWriter

public class XmlWriter extends Object

Extremely simple utility class used to create XML documents.
Constructor Summary
XmlWriter(OutputStream stream)
Creates XmlWriter with the specified output stream to send XML code to.
Method Summary
voidcloseTag()
Closes the corresponding XML tag
protected voidfinalize()
voidflush()
Flushes the output stream
voidstartTag(String tag)
Opens XML tag
voidwriteComment(Object comment)
Writes XML comment to output stream
voidwriteTag(String tag, Object value)
Writes <tag>value</tag> to output stream
voidwriteTag(String tag, int value)
Writes <tag>value</tag> to output stream
voidwriteTag(String tag, long value)
Writes <tag>value</tag> to output stream
voidwriteTag(String tag, double value, String nanString)
Writes <tag>value</tag> to output stream
voidwriteTag(String tag, double value)
Writes <tag>value</tag> to output stream
voidwriteTag(String tag, boolean value)
Writes <tag>value</tag> to output stream
voidwriteTag(String tag, Color value)
Writes <tag>value</tag> to output stream
voidwriteTag(String tag, Font value)
Writes <tag>value</tag> to output stream
voidwriteTag(String tag, File value)
Writes <tag>value</tag> to output stream

Constructor Detail

XmlWriter

public XmlWriter(OutputStream stream)
Creates XmlWriter with the specified output stream to send XML code to.

Parameters: stream Output stream which receives XML code

Method Detail

closeTag

public void closeTag()
Closes the corresponding XML tag

finalize

protected void finalize()

flush

public void flush()
Flushes the output stream

startTag

public void startTag(String tag)
Opens XML tag

Parameters: tag XML tag name

writeComment

public void writeComment(Object comment)
Writes XML comment to output stream

Parameters: comment comment string

writeTag

public void writeTag(String tag, Object value)
Writes <tag>value</tag> to output stream

Parameters: tag XML tag name value value to be placed between <tag> and </tag>

writeTag

public void writeTag(String tag, int value)
Writes <tag>value</tag> to output stream

Parameters: tag XML tag name value value to be placed between <tag> and </tag>

writeTag

public void writeTag(String tag, long value)
Writes <tag>value</tag> to output stream

Parameters: tag XML tag name value value to be placed between <tag> and </tag>

writeTag

public void writeTag(String tag, double value, String nanString)
Writes <tag>value</tag> to output stream

Parameters: tag XML tag name value value to be placed between <tag> and </tag>

writeTag

public void writeTag(String tag, double value)
Writes <tag>value</tag> to output stream

Parameters: tag XML tag name value value to be placed between <tag> and </tag>

writeTag

public void writeTag(String tag, boolean value)
Writes <tag>value</tag> to output stream

Parameters: tag XML tag name value value to be placed between <tag> and </tag>

writeTag

public void writeTag(String tag, Color value)
Writes <tag>value</tag> to output stream

Parameters: tag XML tag name value value to be placed between <tag> and </tag>

writeTag

public void writeTag(String tag, Font value)
Writes <tag>value</tag> to output stream

Parameters: tag XML tag name value value to be placed between <tag> and </tag>

writeTag

public void writeTag(String tag, File value)
Writes <tag>value</tag> to output stream

Parameters: tag XML tag name value value to be placed between <tag> and </tag>