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.IOExceptionpublic void writeStartElement(java.lang.String element)
throws java.io.IOException
java.io.IOExceptionpublic void writeEndElement()
throws java.io.IOException
java.io.IOExceptionpublic 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.IOExceptionpublic void writeAttribute(java.lang.String name,
java.lang.String value,
java.lang.String defaultValue)
throws java.io.IOException
value equals defaultValue.java.io.IOExceptionpublic 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.IOExceptionpublic void writeIntegerAttribute(java.lang.String name,
int value,
int defaultValue)
throws java.io.IOException
value equals defaultValue.java.io.IOExceptionpublic 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.IOExceptionpublic void writeLongAttribute(java.lang.String name,
java.lang.Long value)
throws java.io.IOException
value equals null.java.io.IOExceptionpublic 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.IOExceptionpublic void writeFloatAttribute(java.lang.String name,
float value,
float defaultValue)
throws java.io.IOException
value equals defaultValue.java.io.IOExceptionpublic void writeFloatAttribute(java.lang.String name,
java.lang.Float value)
throws java.io.IOException
value equals null.java.io.IOExceptionpublic void writeBigDecimalAttribute(java.lang.String name,
java.math.BigDecimal value)
throws java.io.IOException
value equals null.java.io.IOExceptionpublic void writeBooleanAttribute(java.lang.String name,
boolean value,
boolean defaultValue)
throws java.io.IOException
value equals defaultValue.java.io.IOExceptionpublic 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.IOExceptionpublic void writeText(java.lang.String text)
throws java.io.IOException
text as the content of the current element.java.io.IOExceptionpublic void write(int c)
throws java.io.IOException
write in class java.io.FilterWriterjava.io.IOExceptionpublic void write(char[] buffer,
int offset,
int length)
throws java.io.IOException
write in class java.io.FilterWriterjava.io.IOExceptionpublic void write(java.lang.String str,
int offset,
int length)
throws java.io.IOException
write in class java.io.FilterWriterjava.io.IOException

© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License