public class XMLWriter
extends java.io.FilterWriter
Constructor and Description |
---|
XMLWriter(java.io.OutputStream out)
Creates a writer in the given output stream encoded in UTF-8.
|
Modifier and Type | Method and Description |
---|---|
void |
write(char[] buffer,
int offset,
int length)
Writes the given characters array as the content of the current element.
|
void |
write(int c)
Writes the given character as the content of the current element.
|
void |
write(java.lang.String str,
int offset,
int length)
Writes the given string as the content of the current element.
|
void |
writeAttribute(java.lang.String name,
java.lang.String value)
Writes the attribute of the given
name with its value
in the tag of the last started element. |
void |
writeAttribute(java.lang.String name,
java.lang.String value,
java.lang.String defaultValue)
Writes the name and the value of an attribute in the tag of the last started element,
except if
value equals defaultValue . |
void |
writeBigDecimalAttribute(java.lang.String name,
java.math.BigDecimal value)
Writes the name and the value of an attribute in the tag of the last started element,
except if
value equals null . |
void |
writeBooleanAttribute(java.lang.String name,
boolean value,
boolean defaultValue)
Writes the name and the boolean value of an attribute in the tag of the last started element,
except if
value equals defaultValue . |
void |
writeColorAttribute(java.lang.String name,
java.lang.Integer color)
Writes the name and the color value of an attribute in the tag of the last started element,
except if
value equals null . |
void |
writeEndElement()
Writes an end tag for the given element.
|
void |
writeFloatAttribute(java.lang.String name,
float value)
Writes the attribute of the given
name with its float value
in the tag of the last started element. |
void |
writeFloatAttribute(java.lang.String name,
java.lang.Float value)
Writes the name and the float value of an attribute in the tag of the last started element,
except if
value equals null . |
void |
writeFloatAttribute(java.lang.String name,
float value,
float defaultValue)
Writes the name and the float value of an attribute in the tag of the last started element,
except if
value equals defaultValue . |
void |
writeIntegerAttribute(java.lang.String name,
int value)
Writes the attribute of the given
name with its integer value
in the tag of the last started element. |
void |
writeIntegerAttribute(java.lang.String name,
int value,
int defaultValue)
Writes the name and the integer value of an attribute in the tag of the last started element,
except if
value equals defaultValue . |
void |
writeLongAttribute(java.lang.String name,
long value)
Writes the attribute of the given
name with its long value
in the tag of the last started element. |
void |
writeLongAttribute(java.lang.String name,
java.lang.Long value)
Writes the name and the long value of an attribute in the tag of the last started element,
except if
value equals null . |
void |
writeStartElement(java.lang.String element)
Writes a start tag for the given element.
|
void |
writeText(java.lang.String text)
Writes the given
text as the content of the current element. |
public XMLWriter(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public void writeStartElement(java.lang.String element) throws java.io.IOException
java.io.IOException
public void writeEndElement() throws java.io.IOException
java.io.IOException
public void writeAttribute(java.lang.String name, java.lang.String value) throws java.io.IOException
name
with its value
in the tag of the last started element.java.io.IOException
public void writeAttribute(java.lang.String name, java.lang.String value, java.lang.String defaultValue) throws java.io.IOException
value
equals defaultValue
.java.io.IOException
public void writeIntegerAttribute(java.lang.String name, int value) throws java.io.IOException
name
with its integer value
in the tag of the last started element.java.io.IOException
public void writeIntegerAttribute(java.lang.String name, int value, int defaultValue) throws java.io.IOException
value
equals defaultValue
.java.io.IOException
public void writeLongAttribute(java.lang.String name, long value) throws java.io.IOException
name
with its long value
in the tag of the last started element.java.io.IOException
public void writeLongAttribute(java.lang.String name, java.lang.Long value) throws java.io.IOException
value
equals null
.java.io.IOException
public void writeFloatAttribute(java.lang.String name, float value) throws java.io.IOException
name
with its float value
in the tag of the last started element.java.io.IOException
public void writeFloatAttribute(java.lang.String name, float value, float defaultValue) throws java.io.IOException
value
equals defaultValue
.java.io.IOException
public void writeFloatAttribute(java.lang.String name, java.lang.Float value) throws java.io.IOException
value
equals null
.java.io.IOException
public void writeBigDecimalAttribute(java.lang.String name, java.math.BigDecimal value) throws java.io.IOException
value
equals null
.java.io.IOException
public void writeBooleanAttribute(java.lang.String name, boolean value, boolean defaultValue) throws java.io.IOException
value
equals defaultValue
.java.io.IOException
public void writeColorAttribute(java.lang.String name, java.lang.Integer color) throws java.io.IOException
value
equals null
. The color is written in hexadecimal.java.io.IOException
public void writeText(java.lang.String text) throws java.io.IOException
text
as the content of the current element.java.io.IOException
public void write(int c) throws java.io.IOException
write
in class java.io.FilterWriter
java.io.IOException
public void write(char[] buffer, int offset, int length) throws java.io.IOException
write
in class java.io.FilterWriter
java.io.IOException
public void write(java.lang.String str, int offset, int length) throws java.io.IOException
write
in class java.io.FilterWriter
java.io.IOException
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License