javax.xml.stream.XMLStreamWriter . It defines methods for
writing XML data from Java types.
Exceptions to throw are declared to be basic XMLStreamExceptions,
because in addition to specific TypedXMLStreamExceptions
(which are more specific subclasses)
that are thrown if conversion itself fails, methods also need to
access underlying textual content which may throw other subtypes
of stream exception.
| Modifier and Type | Method and Description |
|---|---|
| public void | writeBinary(byte[]
The array from which to write the bytes. value, int The index in the array from which writing starts. from, int The number of bytes to write. length)Write binary content as base64 encoded characters to the output. |
| public void | |
| public void | writeBinaryAttribute(String
The attribute's prefix. prefix, String The attribute's URI. namespaceURI, String The attribute's local name. localName, byte[] The array from which to write the bytes. value)Write a byte array attribute. |
| public void | writeBinaryAttribute(Base64Variant variant, String prefix, String namespaceURI, String localName, byte[] value)
|
| public void | writeBoolean(boolean
The boolean value to write. value)Write a boolean value to the output as textual element content. |
| public void | writeBooleanAttribute(String
The attribute's prefix. Null or "" if no prefix is to be used prefix, String The attribute's URI (can be either null or empty String for "no namespace") namespaceURI, String The attribute's local name localName, boolean The boolean value to write. value)Write a boolean value to the output as attribute value. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | writeIntArray(int[]
The array from which to write the ints. value, int The index in the array from which writing starts. from, int The number of ints to write. length)Write int array to the output. |
| public void | writeIntArrayAttribute(String
The attribute's prefix. prefix, String The attribute's URI. namespaceURI, String The attribute's local name. localName, int[] The array from which to write the ints. value)Write int array attribute. |
| public void | writeIntAttribute(String
The attribute's prefix. Null or "" if no prefix is to be used prefix, String The attribute's URI (can be either null or empty String for "no namespace") namespaceURI, String The attribute's local name localName, int The integer value to write. value)Write an integer value to the output as attribute value. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | writeLongAttribute(String
The attribute's prefix. Null or "" if no prefix is to be used prefix, String The attribute's URI (can be either null or empty String for "no namespace") namespaceURI, String The attribute's local name localName, long The long value to write. value)Write an long value to the output as attribute value. |
| public void | |
| public void |
| writeBinary | back to summary |
|---|---|
| public void writeBinary(byte[] value, int from, int length) throws XMLStreamException Write binary content as base64 encoded characters to the output. The lexical representation of a byte array is defined by the XML Schema base64Binary data type. This method can be called multiple times to write the array in chunks; but if so, callers should write output in chunks divisible by 3 (natural atomic unit of base64 output, which avoids padding) to maximize interoperability. Note base64 variant defaults to
| |
| writeBinary | back to summary |
|---|---|
| public void writeBinary(Base64Variant variant, byte[] value, int from, int length) throws XMLStreamException | |
| writeBinaryAttribute | back to summary |
|---|---|
| public void writeBinaryAttribute(String prefix, String namespaceURI, String localName, byte[] value) throws XMLStreamException Write a byte array attribute. The lexical representation of a byte array is defined by the XML Schema base64Binary data type. Note base64 variant defaults to | |
| writeBinaryAttribute | back to summary |
|---|---|
| public void writeBinaryAttribute(Base64Variant variant, String prefix, String namespaceURI, String localName, byte[] value) throws XMLStreamException | |
| writeBoolean | back to summary |
|---|---|
| public void writeBoolean(boolean value) throws XMLStreamException Write a boolean value to the output as textual element content. The lexical representation of content is defined by the XML Schema boolean data type.
| |
| writeBooleanAttribute | back to summary |
|---|---|
| public void writeBooleanAttribute(String prefix, String namespaceURI, String localName, boolean value) throws XMLStreamException Write a boolean value to the output as attribute value. The lexical representation of content is defined by the XML Schema boolean data type. | |
| writeDecimal | back to summary |
|---|---|
| public void writeDecimal(BigDecimal value) throws XMLStreamException Write a decimal value to the output as textual element content. The lexical representation of content is defined by the XML Schema decimal data type. | |
| writeDecimalAttribute | back to summary |
|---|---|
| public void writeDecimalAttribute(String prefix, String namespaceURI, String localName, BigDecimal value) throws XMLStreamException | |
| writeDouble | back to summary |
|---|---|
| public void writeDouble(double value) throws XMLStreamException Write a double value to the output as textual element content. The lexical representation of content is defined by the XML Schema double data type. | |
| writeDoubleArray | back to summary |
|---|---|
| public void writeDoubleArray(double[] value, int from, int length) throws XMLStreamException | |
| writeDoubleArrayAttribute | back to summary |
|---|---|
| public void writeDoubleArrayAttribute(String prefix, String namespaceURI, String localName, double[] value) throws XMLStreamException | |
| writeDoubleAttribute | back to summary |
|---|---|
| public void writeDoubleAttribute(String prefix, String namespaceURI, String localName, double value) throws XMLStreamException | |
| writeFloat | back to summary |
|---|---|
| public void writeFloat(float value) throws XMLStreamException Write a float value to the output as textual element content. The lexical representation of content is defined by the XML Schema float data type. | |
| writeFloatArray | back to summary |
|---|---|
| public void writeFloatArray(float[] value, int from, int length) throws XMLStreamException | |
| writeFloatArrayAttribute | back to summary |
|---|---|
| public void writeFloatArrayAttribute(String prefix, String namespaceURI, String localName, float[] value) throws XMLStreamException | |
| writeFloatAttribute | back to summary |
|---|---|
| public void writeFloatAttribute(String prefix, String namespaceURI, String localName, float value) throws XMLStreamException | |
| writeInt | back to summary |
|---|---|
| public void writeInt(int value) throws XMLStreamException Write an int value to the output as textual element content. The lexical representation of content is defined by the XML Schema integer data type. | |
| writeIntArray | back to summary |
|---|---|
| public void writeIntArray(int[] value, int from, int length) throws XMLStreamException Write int array to the output. The lexical representation of a int array is defined by the following XML schema type:
<xs:simpleType name="intArray">
<xs:list itemType="xs:int"/>
</xs:simpleType>
whose lexical space is a list of space-separated ints.
This method can be called multiple times to write the
array in chunks.
| |
| writeIntArrayAttribute | back to summary |
|---|---|
| public void writeIntArrayAttribute(String prefix, String namespaceURI, String localName, int[] value) throws XMLStreamException Write int array attribute. The lexical representation of a int array is defined by the following XML schema type:
<xs:simpleType name="intArray">
<xs:list itemType="xs:int"/>
</xs:simpleType>
whose lexical space is a list of space-separated ints.
| |
| writeIntAttribute | back to summary |
|---|---|
| public void writeIntAttribute(String prefix, String namespaceURI, String localName, int value) throws XMLStreamException Write an integer value to the output as attribute value. The lexical representation of content is defined by the XML Schema integer data type. | |
| writeInteger | back to summary |
|---|---|
| public void writeInteger(BigInteger value) throws XMLStreamException | |
| writeIntegerAttribute | back to summary |
|---|---|
| public void writeIntegerAttribute(String prefix, String namespaceURI, String localName, BigInteger value) throws XMLStreamException | |
| writeLong | back to summary |
|---|---|
| public void writeLong(long value) throws XMLStreamException Write a long value to the output as textual element content. The lexical representation of content is defined by the XML Schema long data type. | |
| writeLongArray | back to summary |
|---|---|
| public void writeLongArray(long[] value, int from, int length) throws XMLStreamException | |
| writeLongArrayAttribute | back to summary |
|---|---|
| public void writeLongArrayAttribute(String prefix, String namespaceURI, String localName, long[] value) throws XMLStreamException | |
| writeLongAttribute | back to summary |
|---|---|
| public void writeLongAttribute(String prefix, String namespaceURI, String localName, long value) throws XMLStreamException Write an long value to the output as attribute value. The lexical representation of content is defined by the XML Schema long data type. | |
| writeQName | back to summary |
|---|---|
| public void writeQName(QName value) throws XMLStreamException | |
| writeQNameAttribute | back to summary |
|---|---|
| public void writeQNameAttribute(String prefix, String namespaceURI, String localName, QName value) throws XMLStreamException | |