com.sun.mail.handlers

## Class handler_base

- java.lang.Object
- - com.sun.mail.handlers.handler_base

- All Implemented Interfaces:
    DataContentHandler
  Direct Known Subclasses:
    image_gif, message_rfc822, multipart_mixed, text_plain

      public abstract class handler_base
      extends Object
      implements DataContentHandler

  Base class for other DataContentHandlers.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `handler_base()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Object` | `getData(ActivationDataFlavor aFlavor, DataSource ds)` Given the flavor that matched, return the appropriate type of object.
    `protected abstract ActivationDataFlavor[]` | `getDataFlavors()` Return an array of ActivationDataFlavors that we support.
    `Object` | `getTransferData(DataFlavor df, DataSource ds)` Return the Transfer Data of type DataFlavor from InputStream.
    `DataFlavor[]` | `getTransferDataFlavors()` Return the DataFlavors for this `DataContentHandler`.

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

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

    - ### Methods inherited from interface javax.activation.DataContentHandler

      `getContent, writeTo`

- - ### Constructor Detail

    - #### handler_base

          public handler_base()

  - ### Method Detail

    - #### getDataFlavors

          protected abstract ActivationDataFlavor[] getDataFlavors()

      Return an array of ActivationDataFlavors that we support. Usually there will be only one.

    - #### getData

          protected Object getData(ActivationDataFlavor aFlavor,
                       DataSource ds)
                            throws IOException

      Given the flavor that matched, return the appropriate type of object. Usually there's only one flavor so just call getContent.
      Throws:
        `IOException`

    - #### getTransferDataFlavors

          public DataFlavor[] getTransferDataFlavors()

      Return the DataFlavors for this `DataContentHandler`.
      Specified by:
        `getTransferDataFlavors` in interface `DataContentHandler`
      Returns:
        The DataFlavors

    - #### getTransferData

          public Object getTransferData(DataFlavor df,
                               DataSource ds)
                                 throws IOException

      Return the Transfer Data of type DataFlavor from InputStream.
      Specified by:
        `getTransferData` in interface `DataContentHandler`
      Parameters:
        `df` - The DataFlavor
        `ds` - The DataSource corresponding to the data
      Returns:
        String object
      Throws:
        `IOException`

Copyright © 2016 Oracle. All rights reserved.