public class XMLWriter extends FilterWriter
out
Constructor and Description |
---|
XMLWriter(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(String str,
int offset,
int length)
Writes the given string as the content of the current element.
|
void |
writeAttribute(String name,
String value)
Writes the attribute of the given
name with its value
in the tag of the last started element. |
void |
writeAttribute(String name,
String value,
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(String name,
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(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(String name,
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(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(String name,
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(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(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(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(String name,
long value)
Writes the attribute of the given
name with its long value
in the tag of the last started element. |
void |
writeStartElement(String element)
Writes a start tag for the given element.
|
void |
writeText(String text)
Writes the given
text as the content of the current element. |
close, flush
public XMLWriter(OutputStream out) throws IOException
IOException
public void writeStartElement(String element) throws IOException
IOException
public void writeEndElement() throws IOException
IOException
public void writeAttribute(String name, String value) throws IOException
name
with its value
in the tag of the last started element.IOException
public void writeAttribute(String name, String value, String defaultValue) throws IOException
value
equals defaultValue
.IOException
public void writeIntegerAttribute(String name, int value) throws IOException
name
with its integer value
in the tag of the last started element.IOException
public void writeIntegerAttribute(String name, int value, int defaultValue) throws IOException
value
equals defaultValue
.IOException
public void writeLongAttribute(String name, long value) throws IOException
name
with its long value
in the tag of the last started element.IOException
public void writeFloatAttribute(String name, float value) throws IOException
name
with its float value
in the tag of the last started element.IOException
public void writeFloatAttribute(String name, float value, float defaultValue) throws IOException
value
equals defaultValue
.IOException
public void writeFloatAttribute(String name, Float value) throws IOException
value
equals null
.IOException
public void writeBigDecimalAttribute(String name, BigDecimal value) throws IOException
value
equals null
.IOException
public void writeBooleanAttribute(String name, boolean value, boolean defaultValue) throws IOException
value
equals defaultValue
.IOException
public void writeColorAttribute(String name, Integer color) throws IOException
value
equals null
. The color is written in hexadecimal.IOException
public void writeText(String text) throws IOException
text
as the content of the current element.IOException
public void write(int c) throws IOException
write
in class FilterWriter
IOException
public void write(char[] buffer, int offset, int length) throws IOException
write
in class FilterWriter
IOException
public void write(String str, int offset, int length) throws IOException
write
in class FilterWriter
IOException
© Copyrights 2006-2016 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License