Interface DataHandlerReader

    • Field Detail

      • PROPERTY

        static final String PROPERTY
        The name of the property used to look up this extension interface from a XMLStreamReader implementation.
    • Method Detail

      • isOptimized

        boolean isOptimized()
        Check if the binary content is eligible for optimization (e.g. using XOP) or if it should be serialized as base64. Calling this method is only meaningful if isBinary() returns true for the current event. The behavior of this method is undefined if this is not the case.
        Returns:
        true if the binary content is eligible for optimization; false otherwise
      • isDeferred

        boolean isDeferred()
        Check whether the XMLStreamReader supports deferred loading of the binary content for the current event. If this method returns true then a consumer MAY call getDataHandlerProvider() and retrieve the DataHandler later using DataHandlerProvider.getDataHandler(). Calling this method is only meaningful if isBinary() returns true for the current event. The behavior of this method is undefined if this is not the case.
        Returns:
        true if deferred loading is supported; false otherwise
      • getContentID

        String getContentID()
        Get the content ID of the binary content for the current event, if available. The result of this method is defined if and only if isBinary() returns true for the current event.

        The implementation SHOULD only return a non null value if the content ID has been used previously in an interaction with another component or system. The implementation SHOULD NOT generate a new content ID solely for the purpose of this method.

        If available, the returned value MUST be a raw content ID. In particular:

        • If the content ID has been extracted from an href attribute, it MUST NOT contain the cid: prefix.
        • If it has been extracted from a Content-ID MIME header, it MUST NOT be enclosed in angles (<>).

        A consumer MAY use the return value of this method in contexts where it is desirable to preserve the original content ID used by another system or component to identify the binary content. However, the consumer MUST NOT make any assumption about the uniqueness or validity of the content ID (with respect to relevant standards such as RFC822) and SHOULD make provision to sanitize the value if necessary.

        Returns:
        any content ID used previously to identify the binary content, or null if no content ID is known
      • getDataHandler

        DataHandler getDataHandler()
                            throws XMLStreamException
        Get the DataHandler with the binary content for the current event. The behavior of this method is only defined for events for which isBinary() returns true. For events of this type the method MUST return a valid DataHandler, regardless of the return value of isDeferred(). If isDeferred() returns true, then the consumer may use this method to force the implementation to load the binary content immediately.
        Returns:
        the binary content for the current event
        Throws:
        XMLStreamException - if an error occurs while loading the DataHandler
      • getDataHandlerProvider

        DataHandlerProvider getDataHandlerProvider()
        Get a DataHandlerProvider instance for deferred loading of the binary content for the current event. The behavior of this method is defined if and only if isDeferred() returns true for the current event. The returned reference MUST remain valid after the current event has been consumed. It is up to the implementation to specify the exact lifecycle of the returned instance, in particular until when the binary content can be retrieved.
        Returns:
        the DataHandlerProvider instance the consumer can use to load the binary content at a later time