public interface TypedXMLStreamWriter extends XMLStreamWriter
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 |
|---|---|
void |
writeBinary(Base64Variant variant,
byte[] value,
int from,
int length) |
void |
writeBinary(byte[] value,
int from,
int length)
Write binary content as base64 encoded characters to the output.
|
void |
writeBinaryAttribute(Base64Variant variant,
String prefix,
String namespaceURI,
String localName,
byte[] value) |
void |
writeBinaryAttribute(String prefix,
String namespaceURI,
String localName,
byte[] value)
Write a byte array attribute.
|
void |
writeBoolean(boolean value)
Write a boolean value to the output as textual element content.
|
void |
writeBooleanAttribute(String prefix,
String namespaceURI,
String localName,
boolean value)
Write a boolean value to the output as attribute value.
|
void |
writeDecimal(BigDecimal value)
Write a decimal value to the output as textual element content.
|
void |
writeDecimalAttribute(String prefix,
String namespaceURI,
String localName,
BigDecimal value) |
void |
writeDouble(double value)
Write a double value to the output as textual element content.
|
void |
writeDoubleArray(double[] value,
int from,
int length) |
void |
writeDoubleArrayAttribute(String prefix,
String namespaceURI,
String localName,
double[] value) |
void |
writeDoubleAttribute(String prefix,
String namespaceURI,
String localName,
double value) |
void |
writeFloat(float value)
Write a float value to the output as textual element content.
|
void |
writeFloatArray(float[] value,
int from,
int length) |
void |
writeFloatArrayAttribute(String prefix,
String namespaceURI,
String localName,
float[] value) |
void |
writeFloatAttribute(String prefix,
String namespaceURI,
String localName,
float value) |
void |
writeInt(int value)
Write an int value to the output as textual element content.
|
void |
writeIntArray(int[] value,
int from,
int length)
Write int array to the output.
|
void |
writeIntArrayAttribute(String prefix,
String namespaceURI,
String localName,
int[] value)
Write int array attribute.
|
void |
writeIntAttribute(String prefix,
String namespaceURI,
String localName,
int value)
Write an integer value to the output as attribute value.
|
void |
writeInteger(BigInteger value) |
void |
writeIntegerAttribute(String prefix,
String namespaceURI,
String localName,
BigInteger value) |
void |
writeLong(long value)
Write a long value to the output as textual element content.
|
void |
writeLongArray(long[] value,
int from,
int length) |
void |
writeLongArrayAttribute(String prefix,
String namespaceURI,
String localName,
long[] value) |
void |
writeLongAttribute(String prefix,
String namespaceURI,
String localName,
long value)
Write an long value to the output as attribute value.
|
void |
writeQName(QName value) |
void |
writeQNameAttribute(String prefix,
String namespaceURI,
String localName,
QName value) |
close, flush, getNamespaceContext, getPrefix, getProperty, setDefaultNamespace, setNamespaceContext, setPrefix, writeAttribute, writeAttribute, writeAttribute, writeCData, writeCharacters, writeCharacters, writeComment, writeDefaultNamespace, writeDTD, writeEmptyElement, writeEmptyElement, writeEmptyElement, writeEndDocument, writeEndElement, writeEntityRef, writeNamespace, writeProcessingInstruction, writeProcessingInstruction, writeStartDocument, writeStartDocument, writeStartDocument, writeStartElement, writeStartElement, writeStartElementvoid writeBoolean(boolean value)
throws XMLStreamException
value - The boolean value to write.XMLStreamExceptionvoid writeInt(int value)
throws XMLStreamException
XMLStreamExceptionvoid writeLong(long value)
throws XMLStreamException
XMLStreamExceptionvoid writeFloat(float value)
throws XMLStreamException
XMLStreamExceptionvoid writeDouble(double value)
throws XMLStreamException
XMLStreamExceptionvoid writeInteger(BigInteger value) throws XMLStreamException
XMLStreamExceptionvoid writeDecimal(BigDecimal value) throws XMLStreamException
XMLStreamExceptionvoid writeQName(QName value) throws XMLStreamException
XMLStreamExceptionvoid 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 Base64Variants.MIME.
value - The array from which to write the bytes.from - The index in the array from which writing starts.length - The number of bytes to write.XMLStreamExceptionvoid writeBinary(Base64Variant variant, byte[] value, int from, int length) throws XMLStreamException
XMLStreamExceptionvoid 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.value - The array from which to write the ints.from - The index in the array from which writing starts.length - The number of ints to write.XMLStreamExceptionvoid writeLongArray(long[] value,
int from,
int length)
throws XMLStreamException
XMLStreamExceptionvoid writeFloatArray(float[] value,
int from,
int length)
throws XMLStreamException
XMLStreamExceptionvoid writeDoubleArray(double[] value,
int from,
int length)
throws XMLStreamException
XMLStreamExceptionvoid writeBooleanAttribute(String prefix, String namespaceURI, String localName, boolean value) throws XMLStreamException
prefix - The attribute's prefix. Null or "" if no prefix is to be usednamespaceURI - The attribute's URI (can be either null or empty String for "no namespace")localName - The attribute's local namevalue - The boolean value to write.XMLStreamExceptionvoid writeIntAttribute(String prefix, String namespaceURI, String localName, int value) throws XMLStreamException
prefix - The attribute's prefix. Null or "" if no prefix is to be usednamespaceURI - The attribute's URI (can be either null or empty String for "no namespace")localName - The attribute's local namevalue - The integer value to write.XMLStreamExceptionvoid writeLongAttribute(String prefix, String namespaceURI, String localName, long value) throws XMLStreamException
prefix - The attribute's prefix. Null or "" if no prefix is to be usednamespaceURI - The attribute's URI (can be either null or empty String for "no namespace")localName - The attribute's local namevalue - The long value to write.XMLStreamExceptionvoid writeFloatAttribute(String prefix, String namespaceURI, String localName, float value) throws XMLStreamException
XMLStreamExceptionvoid writeDoubleAttribute(String prefix, String namespaceURI, String localName, double value) throws XMLStreamException
XMLStreamExceptionvoid writeIntegerAttribute(String prefix, String namespaceURI, String localName, BigInteger value) throws XMLStreamException
XMLStreamExceptionvoid writeDecimalAttribute(String prefix, String namespaceURI, String localName, BigDecimal value) throws XMLStreamException
XMLStreamExceptionvoid writeQNameAttribute(String prefix, String namespaceURI, String localName, QName value) throws XMLStreamException
XMLStreamExceptionvoid 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 Base64Variants.MIME.
prefix - The attribute's prefix.namespaceURI - The attribute's URI.localName - The attribute's local name.value - The array from which to write the bytes.XMLStreamExceptionvoid writeBinaryAttribute(Base64Variant variant, String prefix, String namespaceURI, String localName, byte[] value) throws XMLStreamException
XMLStreamExceptionvoid 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.prefix - The attribute's prefix.namespaceURI - The attribute's URI.localName - The attribute's local name.value - The array from which to write the ints.XMLStreamExceptionvoid writeLongArrayAttribute(String prefix, String namespaceURI, String localName, long[] value) throws XMLStreamException
XMLStreamExceptionvoid writeFloatArrayAttribute(String prefix, String namespaceURI, String localName, float[] value) throws XMLStreamException
XMLStreamExceptionvoid writeDoubleArrayAttribute(String prefix, String namespaceURI, String localName, double[] value) throws XMLStreamException
XMLStreamExceptionCopyright © 2005–2017 Oracle Corporation. All rights reserved.