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 |
writeLongAttribute(String name,
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(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, flushpublic XMLWriter(OutputStream out) throws IOException
IOExceptionpublic void writeStartElement(String element) throws IOException
IOExceptionpublic void writeEndElement()
throws IOException
IOExceptionpublic void writeAttribute(String name, String value) throws IOException
name with its value
in the tag of the last started element.IOExceptionpublic void writeAttribute(String name, String value, String defaultValue) throws IOException
value equals defaultValue.IOExceptionpublic void writeIntegerAttribute(String name, int value) throws IOException
name with its integer value
in the tag of the last started element.IOExceptionpublic void writeIntegerAttribute(String name, int value, int defaultValue) throws IOException
value equals defaultValue.IOExceptionpublic void writeLongAttribute(String name, long value) throws IOException
name with its long value
in the tag of the last started element.IOExceptionpublic void writeLongAttribute(String name, Long value) throws IOException
value equals null.IOExceptionpublic void writeFloatAttribute(String name, float value) throws IOException
name with its float value
in the tag of the last started element.IOExceptionpublic void writeFloatAttribute(String name, float value, float defaultValue) throws IOException
value equals defaultValue.IOExceptionpublic void writeFloatAttribute(String name, Float value) throws IOException
value equals null.IOExceptionpublic void writeBigDecimalAttribute(String name, BigDecimal value) throws IOException
value equals null.IOExceptionpublic void writeBooleanAttribute(String name, boolean value, boolean defaultValue) throws IOException
value equals defaultValue.IOExceptionpublic void writeColorAttribute(String name, Integer color) throws IOException
value equals null. The color is written in hexadecimal.IOExceptionpublic void writeText(String text) throws IOException
text as the content of the current element.IOExceptionpublic void write(int c)
throws IOException
write in class FilterWriterIOExceptionpublic void write(char[] buffer,
int offset,
int length)
throws IOException
write in class FilterWriterIOExceptionpublic void write(String str, int offset, int length) throws IOException
write in class FilterWriterIOException

© Copyrights 2006-2017 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License