Interface TypedXMLStreamWriter
-
- All Superinterfaces:
javax.xml.stream.XMLStreamWriter
- All Known Subinterfaces:
XMLStreamWriter2
- All Known Implementing Classes:
DOMWrappingWriter,Stax2WriterAdapter,Stax2WriterImpl,StreamWriter2Delegate
public interface TypedXMLStreamWriter extends javax.xml.stream.XMLStreamWriterThis interface provides a typed extension toXMLStreamWriter. It defines methods for writing XML data from Java types.Exceptions to throw are declared to be basic
XMLStreamExceptions, because in addition to specificTypedXMLStreamExceptions (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.- Since:
- 3.0
- Author:
- Santiago.PericasGeertsen@sun.com, Tatu Saloranta
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidwriteBinary(byte[] value, int from, int length)Write binary content as base64 encoded characters to the output.voidwriteBinary(Base64Variant variant, byte[] value, int from, int length)voidwriteBinaryAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, byte[] value)Write a byte array attribute.voidwriteBinaryAttribute(Base64Variant variant, java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, byte[] value)voidwriteBoolean(boolean value)Write a boolean value to the output as textual element content.voidwriteBooleanAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, boolean value)Write a boolean value to the output as attribute value.voidwriteDecimal(java.math.BigDecimal value)Write a decimal value to the output as textual element content.voidwriteDecimalAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, java.math.BigDecimal value)voidwriteDouble(double value)Write a double value to the output as textual element content.voidwriteDoubleArray(double[] value, int from, int length)voidwriteDoubleArrayAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, double[] value)voidwriteDoubleAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, double value)voidwriteFloat(float value)Write a float value to the output as textual element content.voidwriteFloatArray(float[] value, int from, int length)voidwriteFloatArrayAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, float[] value)voidwriteFloatAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, float value)voidwriteInt(int value)Write an int value to the output as textual element content.voidwriteIntArray(int[] value, int from, int length)Write int array to the output.voidwriteIntArrayAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, int[] value)Write int array attribute.voidwriteIntAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, int value)Write an integer value to the output as attribute value.voidwriteInteger(java.math.BigInteger value)voidwriteIntegerAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, java.math.BigInteger value)voidwriteLong(long value)Write a long value to the output as textual element content.voidwriteLongArray(long[] value, int from, int length)voidwriteLongArrayAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, long[] value)voidwriteLongAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, long value)Write an long value to the output as attribute value.voidwriteQName(javax.xml.namespace.QName value)voidwriteQNameAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, javax.xml.namespace.QName value)-
Methods inherited from interface javax.xml.stream.XMLStreamWriter
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, writeStartElement
-
-
-
-
Method Detail
-
writeBoolean
void writeBoolean(boolean value) throws javax.xml.stream.XMLStreamExceptionWrite a boolean value to the output as textual element content. The lexical representation of content is defined by the XML Schema boolean data type.- Parameters:
value- The boolean value to write.- Throws:
javax.xml.stream.XMLStreamException
-
writeInt
void writeInt(int value) throws javax.xml.stream.XMLStreamExceptionWrite an int value to the output as textual element content. The lexical representation of content is defined by the XML Schema integer data type.- Throws:
javax.xml.stream.XMLStreamException
-
writeLong
void writeLong(long value) throws javax.xml.stream.XMLStreamExceptionWrite a long value to the output as textual element content. The lexical representation of content is defined by the XML Schema long data type.- Throws:
javax.xml.stream.XMLStreamException
-
writeFloat
void writeFloat(float value) throws javax.xml.stream.XMLStreamExceptionWrite a float value to the output as textual element content. The lexical representation of content is defined by the XML Schema float data type.- Throws:
javax.xml.stream.XMLStreamException
-
writeDouble
void writeDouble(double value) throws javax.xml.stream.XMLStreamExceptionWrite a double value to the output as textual element content. The lexical representation of content is defined by the XML Schema double data type.- Throws:
javax.xml.stream.XMLStreamException
-
writeInteger
void writeInteger(java.math.BigInteger value) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
writeDecimal
void writeDecimal(java.math.BigDecimal value) throws javax.xml.stream.XMLStreamExceptionWrite a decimal value to the output as textual element content. The lexical representation of content is defined by the XML Schema decimal data type.- Throws:
javax.xml.stream.XMLStreamException
-
writeQName
void writeQName(javax.xml.namespace.QName value) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
writeBinary
void writeBinary(byte[] value, int from, int length) throws javax.xml.stream.XMLStreamExceptionWrite 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.- Parameters:
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.- Throws:
javax.xml.stream.XMLStreamException
-
writeBinary
void writeBinary(Base64Variant variant, byte[] value, int from, int length) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
writeIntArray
void writeIntArray(int[] value, int from, int length) throws javax.xml.stream.XMLStreamExceptionWrite 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.- Parameters:
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.- Throws:
javax.xml.stream.XMLStreamException
-
writeLongArray
void writeLongArray(long[] value, int from, int length) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
writeFloatArray
void writeFloatArray(float[] value, int from, int length) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
writeDoubleArray
void writeDoubleArray(double[] value, int from, int length) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
writeBooleanAttribute
void writeBooleanAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, boolean value) throws javax.xml.stream.XMLStreamExceptionWrite a boolean value to the output as attribute value. The lexical representation of content is defined by the XML Schema boolean data type.- Parameters:
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.- Throws:
javax.xml.stream.XMLStreamException
-
writeIntAttribute
void writeIntAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, int value) throws javax.xml.stream.XMLStreamExceptionWrite an integer value to the output as attribute value. The lexical representation of content is defined by the XML Schema integer data type.- Parameters:
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.- Throws:
javax.xml.stream.XMLStreamException
-
writeLongAttribute
void writeLongAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, long value) throws javax.xml.stream.XMLStreamExceptionWrite an long value to the output as attribute value. The lexical representation of content is defined by the XML Schema long data type.- Parameters:
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.- Throws:
javax.xml.stream.XMLStreamException
-
writeFloatAttribute
void writeFloatAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, float value) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
writeDoubleAttribute
void writeDoubleAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, double value) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
writeIntegerAttribute
void writeIntegerAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, java.math.BigInteger value) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
writeDecimalAttribute
void writeDecimalAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, java.math.BigDecimal value) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
writeQNameAttribute
void writeQNameAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, javax.xml.namespace.QName value) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
writeBinaryAttribute
void writeBinaryAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, byte[] value) throws javax.xml.stream.XMLStreamExceptionWrite 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.- Parameters:
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.- Throws:
javax.xml.stream.XMLStreamException
-
writeBinaryAttribute
void writeBinaryAttribute(Base64Variant variant, java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, byte[] value) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
writeIntArrayAttribute
void writeIntArrayAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, int[] value) throws javax.xml.stream.XMLStreamExceptionWrite 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.- Parameters:
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.- Throws:
javax.xml.stream.XMLStreamException
-
writeLongArrayAttribute
void writeLongArrayAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, long[] value) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
writeFloatArrayAttribute
void writeFloatArrayAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, float[] value) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
writeDoubleArrayAttribute
void writeDoubleArrayAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, double[] value) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
-