Class XOPEncodingStreamReader

java.lang.Object
org.apache.axiom.util.stax.xop.XOPEncodingStreamWrapper
org.apache.axiom.util.stax.xop.XOPEncodingStreamReader
All Implemented Interfaces:
XMLStreamConstants, XMLStreamReader, MimePartProvider

public class XOPEncodingStreamReader extends XOPEncodingStreamWrapper implements XMLStreamReader
XMLStreamReader wrapper that encodes XOP. It assumes that the underlying reader implements the extension defined by DataHandlerReader so that it can identify the information items to optimize (by looking for XMLStreamConstants.CHARACTERS events for which DataHandlerReader.isBinary() returns true). The DataHandler objects for the parts referenced by xop:Include element information items produced by an instance of this class can be retrieved using the XOPEncodingStreamWrapper.getDataHandler(String) method.

Note that the primary purpose of this class is not to serialize an XML infoset to an XOP package (this is better done using XOPEncodingStreamWriter), but rather to optimize interaction (by exchanging DataHandler objects instead of base64 encoded representations) with databinding frameworks that understand XOP, but that are not aware of the DataHandlerReader extension.

This class defers loading of DataHandler objects until XOPEncodingStreamWrapper.getDataHandler(String) is called, except if this is not supported by the underlying stream.