org.codehaus.stax2.typed
Interface TypedXMLStreamWriter


public interface TypedXMLStreamWriter

This interface provides a typed extension to XMLStreamWriter. It defines methods for writing XML data from Java types.

Author:
Santiago.PericasGeertsen@sun.com, Tatu Saloranta

Method Summary
 void writeBinary(byte[] value, int from, int length)
          Write a byte array to the output.
 void writeBinaryAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, byte[] value)
          Write a byte array attribute.
 void writeBoolean(boolean value)
          Write a boolean value to the output.
 void writeBooleanAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, boolean value)
          Write a boolean attribute.
 void writeDecimal(java.math.BigDecimal value)
          [TODO] Same as writeBoolean(boolean) replacing boolean by decimal.
 void writeDecimalAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, java.math.BigDecimal value)
          [TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by decimal.
 void writeDouble(double value)
          [TODO] Same as writeBoolean(boolean) replacing boolean by double.
 void writeDoubleArray(double[] value, int from, int length)
          [TODO] Same as writeIntArray(int[], int, int) replacing int by double.
 void writeDoubleArrayAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, double[] value)
          [TODO] Same as writeIntArrayAttribute(String, String, String, int[]) replacing int by double.
 void writeDoubleAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, double value)
          [TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by double.
 void writeFloat(float value)
          [TODO] Same as writeBoolean(boolean) replacing boolean by float.
 void writeFloatArray(float[] value, int from, int length)
          [TODO] Same as writeIntArray(int[], int, int) replacing int by float.
 void writeFloatArrayAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, float[] value)
          [TODO] Same as writeIntArrayAttribute(String, String, String, int[]) replacing int by float.
 void writeFloatAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, float value)
          [TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by float.
 void writeInt(int value)
          [TODO] Same as writeBoolean(boolean) replacing boolean by int.
 void writeIntArray(int[] value, int from, int length)
          Write int array to the output.
 void writeIntArrayAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, int[] value)
          Write int array attribute.
 void writeIntAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, int value)
          [TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by int.
 void writeInteger(java.math.BigInteger value)
          [TODO] Same as writeBoolean(boolean) replacing boolean by integer.
 void writeIntegerAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, java.math.BigInteger value)
          [TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by integer.
 void writeLong(long value)
          [TODO] Same as writeBoolean(boolean) replacing boolean by long.
 void writeLongArray(long[] value, int from, int length)
          [TODO] Same as writeIntArray(int[], int, int) replacing int by long.
 void writeLongArrayAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, long[] value)
          [TODO] Same as writeIntArrayAttribute(String, String, String, int[]) replacing int by long.
 void writeLongAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, long value)
          [TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by long.
 void writeQName(javax.xml.namespace.QName value)
          [TODO] Same as writeBoolean(boolean) replacing boolean by QName.
 void writeQNameAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, javax.xml.namespace.QName value)
          [TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by QName.
 

Method Detail

writeBoolean

public void writeBoolean(boolean value)
                  throws TypedXMLStreamException

Write a boolean value to the output. The lexical representation of a boolean is defined by the XML Schema boolean data type.

Parameters:
value - The boolean value to write.
Throws:
TypedXMLStreamException

writeInt

public void writeInt(int value)
              throws TypedXMLStreamException

[TODO] Same as writeBoolean(boolean) replacing boolean by int.

Throws:
TypedXMLStreamException

writeLong

public void writeLong(long value)
               throws TypedXMLStreamException

[TODO] Same as writeBoolean(boolean) replacing boolean by long.

Throws:
TypedXMLStreamException

writeFloat

public void writeFloat(float value)
                throws TypedXMLStreamException

[TODO] Same as writeBoolean(boolean) replacing boolean by float.

Throws:
TypedXMLStreamException

writeDouble

public void writeDouble(double value)
                 throws TypedXMLStreamException

[TODO] Same as writeBoolean(boolean) replacing boolean by double.

Throws:
TypedXMLStreamException

writeInteger

public void writeInteger(java.math.BigInteger value)
                  throws TypedXMLStreamException

[TODO] Same as writeBoolean(boolean) replacing boolean by integer.

Throws:
TypedXMLStreamException

writeDecimal

public void writeDecimal(java.math.BigDecimal value)
                  throws TypedXMLStreamException

[TODO] Same as writeBoolean(boolean) replacing boolean by decimal.

Throws:
TypedXMLStreamException

writeQName

public void writeQName(javax.xml.namespace.QName value)
                throws TypedXMLStreamException

[TODO] Same as writeBoolean(boolean) replacing boolean by QName.

Throws:
TypedXMLStreamException

writeBinary

public void writeBinary(byte[] value,
                        int from,
                        int length)
                 throws TypedXMLStreamException

Write a byte array 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.

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:
TypedXMLStreamException

writeIntArray

public void writeIntArray(int[] value,
                          int from,
                          int length)
                   throws TypedXMLStreamException

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.

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:
TypedXMLStreamException

writeLongArray

public void writeLongArray(long[] value,
                           int from,
                           int length)
                    throws TypedXMLStreamException

[TODO] Same as writeIntArray(int[], int, int) replacing int by long.

Throws:
TypedXMLStreamException

writeFloatArray

public void writeFloatArray(float[] value,
                            int from,
                            int length)
                     throws TypedXMLStreamException

[TODO] Same as writeIntArray(int[], int, int) replacing int by float.

Throws:
TypedXMLStreamException

writeDoubleArray

public void writeDoubleArray(double[] value,
                             int from,
                             int length)
                      throws TypedXMLStreamException

[TODO] Same as writeIntArray(int[], int, int) replacing int by double.

Throws:
TypedXMLStreamException

writeBooleanAttribute

public void writeBooleanAttribute(java.lang.String prefix,
                                  java.lang.String namespaceURI,
                                  java.lang.String localName,
                                  boolean value)
                           throws TypedXMLStreamException

Write a boolean attribute. The lexical representation of a boolean is defined by the XML Schema boolean data type.

Parameters:
prefix - The attribute's prefix.
namespaceURI - The attribute's URI.
localName - The attribute's local name.
value - The boolean value to write.
Throws:
TypedXMLStreamException

writeIntAttribute

public void writeIntAttribute(java.lang.String prefix,
                              java.lang.String namespaceURI,
                              java.lang.String localName,
                              int value)
                       throws TypedXMLStreamException

[TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by int.

Throws:
TypedXMLStreamException

writeLongAttribute

public void writeLongAttribute(java.lang.String prefix,
                               java.lang.String namespaceURI,
                               java.lang.String localName,
                               long value)
                        throws TypedXMLStreamException

[TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by long.

Throws:
TypedXMLStreamException

writeFloatAttribute

public void writeFloatAttribute(java.lang.String prefix,
                                java.lang.String namespaceURI,
                                java.lang.String localName,
                                float value)
                         throws TypedXMLStreamException

[TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by float.

Throws:
TypedXMLStreamException

writeDoubleAttribute

public void writeDoubleAttribute(java.lang.String prefix,
                                 java.lang.String namespaceURI,
                                 java.lang.String localName,
                                 double value)
                          throws TypedXMLStreamException

[TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by double.

Throws:
TypedXMLStreamException

writeIntegerAttribute

public void writeIntegerAttribute(java.lang.String prefix,
                                  java.lang.String namespaceURI,
                                  java.lang.String localName,
                                  java.math.BigInteger value)
                           throws TypedXMLStreamException

[TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by integer.

Throws:
TypedXMLStreamException

writeDecimalAttribute

public void writeDecimalAttribute(java.lang.String prefix,
                                  java.lang.String namespaceURI,
                                  java.lang.String localName,
                                  java.math.BigDecimal value)
                           throws TypedXMLStreamException

[TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by decimal.

Throws:
TypedXMLStreamException

writeQNameAttribute

public void writeQNameAttribute(java.lang.String prefix,
                                java.lang.String namespaceURI,
                                java.lang.String localName,
                                javax.xml.namespace.QName value)
                         throws TypedXMLStreamException

[TODO] Same as writeBooleanAttribute(String, String, String, boolean) replacing boolean by QName.

Throws:
TypedXMLStreamException

writeBinaryAttribute

public void writeBinaryAttribute(java.lang.String prefix,
                                 java.lang.String namespaceURI,
                                 java.lang.String localName,
                                 byte[] value)
                          throws TypedXMLStreamException

Write a byte array attribute. The lexical representation of a byte array is defined by the XML Schema base64Binary data type.

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:
TypedXMLStreamException

writeIntArrayAttribute

public void writeIntArrayAttribute(java.lang.String prefix,
                                   java.lang.String namespaceURI,
                                   java.lang.String localName,
                                   int[] value)
                            throws TypedXMLStreamException

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.

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:
TypedXMLStreamException

writeLongArrayAttribute

public void writeLongArrayAttribute(java.lang.String prefix,
                                    java.lang.String namespaceURI,
                                    java.lang.String localName,
                                    long[] value)
                             throws TypedXMLStreamException

[TODO] Same as writeIntArrayAttribute(String, String, String, int[]) replacing int by long.

Throws:
TypedXMLStreamException

writeFloatArrayAttribute

public void writeFloatArrayAttribute(java.lang.String prefix,
                                     java.lang.String namespaceURI,
                                     java.lang.String localName,
                                     float[] value)
                              throws TypedXMLStreamException

[TODO] Same as writeIntArrayAttribute(String, String, String, int[]) replacing int by float.

Throws:
TypedXMLStreamException

writeDoubleArrayAttribute

public void writeDoubleArrayAttribute(java.lang.String prefix,
                                      java.lang.String namespaceURI,
                                      java.lang.String localName,
                                      double[] value)
                               throws TypedXMLStreamException

[TODO] Same as writeIntArrayAttribute(String, String, String, int[]) replacing int by double.

Throws:
TypedXMLStreamException