Package com.sun.mail.handlers
Class handler_base
- java.lang.Object
-
- com.sun.mail.handlers.handler_base
-
- All Implemented Interfaces:
jakarta.activation.DataContentHandler
- Direct Known Subclasses:
image_gif,message_rfc822,multipart_mixed,text_plain
public abstract class handler_base extends Object implements jakarta.activation.DataContentHandler
Base class for other DataContentHandlers.
-
-
Constructor Summary
Constructors Constructor Description handler_base()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ObjectgetData(jakarta.activation.ActivationDataFlavor aFlavor, jakarta.activation.DataSource ds)Given the flavor that matched, return the appropriate type of object.protected abstract jakarta.activation.ActivationDataFlavor[]getDataFlavors()Return an array of ActivationDataFlavors that we support.ObjectgetTransferData(jakarta.activation.ActivationDataFlavor df, jakarta.activation.DataSource ds)Return the Transfer Data of type ActivationDataFlavor from InputStream.jakarta.activation.ActivationDataFlavor[]getTransferDataFlavors()Return the ActivationDataFlavors for thisDataContentHandler.
-
-
-
Method Detail
-
getDataFlavors
protected abstract jakarta.activation.ActivationDataFlavor[] getDataFlavors()
Return an array of ActivationDataFlavors that we support. Usually there will be only one.- Returns:
- array of ActivationDataFlavors that we support
-
getData
protected Object getData(jakarta.activation.ActivationDataFlavor aFlavor, jakarta.activation.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.- Parameters:
aFlavor- the ActivationDataFlavords- DataSource containing the data- Returns:
- the object
- Throws:
IOException- for errors reading the data
-
getTransferDataFlavors
public jakarta.activation.ActivationDataFlavor[] getTransferDataFlavors()
Return the ActivationDataFlavors for thisDataContentHandler.- Specified by:
getTransferDataFlavorsin interfacejakarta.activation.DataContentHandler- Returns:
- The ActivationDataFlavors
-
getTransferData
public Object getTransferData(jakarta.activation.ActivationDataFlavor df, jakarta.activation.DataSource ds) throws IOException
Return the Transfer Data of type ActivationDataFlavor from InputStream.- Specified by:
getTransferDatain interfacejakarta.activation.DataContentHandler- Parameters:
df- The ActivationDataFlavords- The DataSource corresponding to the data- Returns:
- the object
- Throws:
IOException- for errors reading the data
-
-