org.apache.axiom.util.stax.xop

## Class XOPEncodingStreamWrapper

- java.lang.Object
- - org.apache.axiom.util.stax.xop.XOPEncodingStreamWrapper

- All Implemented Interfaces:
    MimePartProvider
  Direct Known Subclasses:
    XOPEncodingStreamReader, XOPEncodingStreamWriter

      public abstract class XOPEncodingStreamWrapper
      extends Object
      implements MimePartProvider

  Base class for `XOPEncodingStreamReader` and `XOPEncodingStreamWriter`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XOPEncodingStreamWrapper(ContentIDGenerator contentIDGenerator, OptimizationPolicy optimizationPolicy)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set` | `getContentIDs()` Get the set of content IDs referenced in `xop:Include` element information items produced by this wrapper.
    `javax.activation.DataHandler` | `getDataHandler(String contentID)` Get the `DataHandler` for the MIME part identified by a given content ID.
    `boolean` | `isLoaded(String contentID)` Check whether the MIME part identified by a given content ID has already been loaded.
    `protected String` | `processDataHandler(DataHandlerProvider dataHandlerProvider, String existingContentID, boolean optimize)`
    `protected String` | `processDataHandler(javax.activation.DataHandler dataHandler, String existingContentID, boolean optimize)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XOPEncodingStreamWrapper

          public XOPEncodingStreamWrapper(ContentIDGenerator contentIDGenerator,
                                          OptimizationPolicy optimizationPolicy)

  - ### Method Detail

    - #### processDataHandler

          protected String processDataHandler(javax.activation.DataHandler dataHandler,
                                              String existingContentID,
                                              boolean optimize)
                                       throws IOException

      Throws:
        `IOException`

    - #### processDataHandler

          protected String processDataHandler(DataHandlerProvider dataHandlerProvider,
                                              String existingContentID,
                                              boolean optimize)
                                       throws IOException

      Throws:
        `IOException`

    - #### getContentIDs

          public Set getContentIDs()

      Get the set of content IDs referenced in `xop:Include` element information items produced by this wrapper.
      Returns:
        The set of content IDs in their order of appearance in the infoset. If no `xop:Include` element information items have been produced yet, an empty set will be returned.

    - #### isLoaded

          public boolean isLoaded(String contentID)

      Description copied from interface: `MimePartProvider`
      Check whether the MIME part identified by a given content ID has already been loaded. A return value of `true` means that a call to `MimePartProvider.getDataHandler(String)` (for the same content ID) will not block or will retrieve the `DataHandler` without overhead.
      Specified by:
        `isLoaded` in interface `MimePartProvider`
      Returns:
        `true` if the MIME part has already been loaded; `false` otherwise

    - #### getDataHandler

          public javax.activation.DataHandler getDataHandler(String contentID)
                                                      throws IOException

      Description copied from interface: `MimePartProvider`
      Get the `DataHandler` for the MIME part identified by a given content ID.
      Specified by:
        `getDataHandler` in interface `MimePartProvider`
      Parameters:
        `contentID` - a content ID referenced in an `xop:Include` element
      Returns:
        the `DataHandler` for the MIME part identified by the content ID; may not be `null`
      Throws:
        `IOException` - if an error occurred while loading the part

Copyright © The Apache Software Foundation. All Rights Reserved.