Class ObjectDataContentHandler

java.lang.Object
jakarta.activation.ObjectDataContentHandler
All Implemented Interfaces:
DataContentHandler

class ObjectDataContentHandler extends Object implements DataContentHandler
  • Field Details

  • Constructor Details

  • Method Details

    • getDCH

      public DataContentHandler getDCH()
      Return the DataContentHandler for this object. Used only by the DataHandler class.
    • getTransferDataFlavors

      public ActivationDataFlavor[] getTransferDataFlavors()
      Return the ActivationDataFlavors for this DataContentHandler.
      Specified by:
      getTransferDataFlavors in interface DataContentHandler
      Returns:
      the ActivationDataFlavors
    • getTransferData

      public Object getTransferData(ActivationDataFlavor df, DataSource ds) throws IOException
      Return the Transfer Data of type ActivationDataFlavor from InputStream.
      Specified by:
      getTransferData in interface DataContentHandler
      Parameters:
      df - the ActivationDataFlavor
      ds - the DataSource
      Returns:
      the constructed Object
      Throws:
      IOException - if the handler doesn't support the requested flavor
    • getContent

      public Object getContent(DataSource ds)
      Description copied from interface: DataContentHandler
      Return an object representing the data in its most preferred form. Generally this will be the form described by the first ActivationDataFlavor returned by the getTransferDataFlavors method.
      Specified by:
      getContent in interface DataContentHandler
      Parameters:
      ds - The DataSource representing the data to be converted.
      Returns:
      The constructed Object.
    • writeTo

      public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException
      Write the object to the output stream.
      Specified by:
      writeTo in interface DataContentHandler
      Parameters:
      obj - The object to be converted.
      mimeType - The requested MIME type of the resulting byte stream.
      os - The output stream into which to write the converted byte stream.
      Throws:
      IOException - errors writing to the stream