public class XmlWriter extends Object
Modifier and Type | Field | Description |
---|---|---|
(package private) static String |
INDENT_STR |
Constructor | Description |
---|---|
XmlWriter(OutputStream stream) |
Creates XmlWriter with the specified output stream to send XML code to.
|
Modifier and Type | Method | Description |
---|---|---|
void |
closeTag() |
Closes the corresponding XML tag
|
protected void |
finalize() |
|
void |
flush() |
Flushes the output stream
|
void |
startTag(String tag) |
Opens XML tag
|
void |
writeComment(Object comment) |
Writes XML comment to output stream
|
void |
writeTag(String tag,
boolean value) |
Writes <tag>value</tag> to output stream
|
void |
writeTag(String tag,
double value) |
Writes <tag>value</tag> to output stream
|
void |
writeTag(String tag,
double value,
String nanString) |
Writes <tag>value</tag> to output stream
|
void |
writeTag(String tag,
int value) |
Writes <tag>value</tag> to output stream
|
void |
writeTag(String tag,
long value) |
Writes <tag>value</tag> to output stream
|
void |
writeTag(String tag,
Color value) |
Writes <tag>value</tag> to output stream
|
void |
writeTag(String tag,
Font value) |
Writes <tag>value</tag> to output stream
|
void |
writeTag(String tag,
File value) |
Writes <tag>value</tag> to output stream
|
void |
writeTag(String tag,
Object value) |
Writes <tag>value</tag> to output stream
|
static final String INDENT_STR
public XmlWriter(OutputStream stream)
stream
- Output stream which receives XML codepublic void startTag(String tag)
tag
- XML tag namepublic void closeTag()
public void writeTag(String tag, Object value)
tag
- XML tag namevalue
- value to be placed between <tag>
and </tag>
public void writeTag(String tag, int value)
tag
- XML tag namevalue
- value to be placed between <tag>
and </tag>
public void writeTag(String tag, long value)
tag
- XML tag namevalue
- value to be placed between <tag>
and </tag>
public void writeTag(String tag, double value, String nanString)
tag
- XML tag namevalue
- value to be placed between <tag>
and </tag>
nanString
- string to display if the value is NaN.public void writeTag(String tag, double value)
tag
- XML tag namevalue
- value to be placed between <tag>
and </tag>
public void writeTag(String tag, boolean value)
tag
- XML tag namevalue
- value to be placed between <tag>
and </tag>
public void writeTag(String tag, Color value)
tag
- XML tag namevalue
- value to be placed between <tag>
and </tag>
public void writeTag(String tag, Font value)
tag
- XML tag namevalue
- value to be placed between <tag>
and </tag>
public void writeTag(String tag, File value)
tag
- XML tag namevalue
- value to be placed between <tag>
and </tag>
public void flush()
protected void finalize() throws Throwable
public void writeComment(Object comment)
comment
- comment string