Interface XMLStreamWriterEx

  • All Superinterfaces:
    XMLStreamWriter

    public interface XMLStreamWriterEx
    extends XMLStreamWriter
    XMLStreamWriter extended to support XOP.

    Some infoset serializer (such as XOP encoder, FastInfoset) uses a format that can represent binary data more efficiently than base64 encoding. Such infoset serializer may choose to implement this interface, to allow the caller to pass in binary data more efficiently without first converting it to binary data.

    Callers capable of using this interface can see if the serializer supports it by simply downcasting XMLStreamWriter to XMLStreamWriterEx.

    TODO

    1. Add methods to write other primitive types, such as hex and integers (and arrays of). A textual implementation would write characters in accordance to the canonical lexical definitions specified in W3C XML Schema: datatypes. A MTOM implementation would write characters except for the case where octets that would otherwise be base64 encoded when using the textual implementation. A Fast Infoset implementation would encoded binary data the primitive types in binary form.
    2. Consider renaming writeBinary to writeBytesAsBase64 to be consistent with infoset abstraction.
    3. Add the ability to writeStart and writeEnd on attributes so that the same methods for writing primitive types (and characters, which will require new methods) can be used for writing attribute values as well as element content.
    Author:
    Kohsuke Kawaguchi, Paul Sandoz
    See Also:
    XMLStreamReaderEx