Package org.jrobin.core
Class XmlWriter
- java.lang.Object
-
- org.jrobin.core.XmlWriter
-
public class XmlWriter extends Object
Extremely simple utility class used to create XML documents.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static String
INDENT_STR
-
Constructor Summary
Constructors Constructor Description XmlWriter(OutputStream stream)
Creates XmlWriter with the specified output stream to send XML code to.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeTag()
Closes the corresponding XML tagprotected void
finalize()
void
flush()
Flushes the output streamvoid
startTag(String tag)
Opens XML tagvoid
writeComment(Object comment)
Writes XML comment to output streamvoid
writeTag(String tag, boolean value)
Writes <tag>value</tag> to output streamvoid
writeTag(String tag, double value)
Writes <tag>value</tag> to output streamvoid
writeTag(String tag, double value, String nanString)
Writes <tag>value</tag> to output streamvoid
writeTag(String tag, int value)
Writes <tag>value</tag> to output streamvoid
writeTag(String tag, long value)
Writes <tag>value</tag> to output streamvoid
writeTag(String tag, Color value)
Writes <tag>value</tag> to output streamvoid
writeTag(String tag, Font value)
Writes <tag>value</tag> to output streamvoid
writeTag(String tag, File value)
Writes <tag>value</tag> to output streamvoid
writeTag(String tag, Object value)
Writes <tag>value</tag> to output stream
-
-
-
Field Detail
-
INDENT_STR
static final String INDENT_STR
- See Also:
- Constant Field Values
-
-
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
-
startTag
public void startTag(String tag)
Opens XML tag- Parameters:
tag
- XML tag name
-
closeTag
public void closeTag()
Closes the corresponding XML tag
-
writeTag
public void writeTag(String tag, Object value)
Writes <tag>value</tag> to output stream- Parameters:
tag
- XML tag namevalue
- 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 namevalue
- 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 namevalue
- 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 namevalue
- value to be placed between<tag>
and</tag>
nanString
- string to display if the value is NaN.
-
writeTag
public void writeTag(String tag, double value)
Writes <tag>value</tag> to output stream- Parameters:
tag
- XML tag namevalue
- 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 namevalue
- 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 namevalue
- 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 namevalue
- 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 namevalue
- value to be placed between<tag>
and</tag>
-
flush
public void flush()
Flushes the output stream
-
finalize
protected void finalize() throws Throwable
-
writeComment
public void writeComment(Object comment)
Writes XML comment to output stream- Parameters:
comment
- comment string
-
-