org.apache.james.util.mail.handlers
Class AbstractDataContentHandler

java.lang.Object
  extended by org.apache.james.util.mail.handlers.AbstractDataContentHandler
All Implemented Interfaces:
javax.activation.DataContentHandler
Direct Known Subclasses:
message_disposition_notification, multipart_report

public abstract class AbstractDataContentHandler
extends java.lang.Object
implements javax.activation.DataContentHandler

Abstract class providing common Data Handler behavior.


Constructor Summary
AbstractDataContentHandler()
          Default Constructor
 
Method Summary
protected abstract  java.lang.Object computeContent(javax.activation.DataSource aDataSource)
          Compute the content from aDataSource.
protected abstract  javax.activation.ActivationDataFlavor computeDataFlavor()
          Compute an ActivationDataFlavor.
 java.lang.Object getContent(javax.activation.DataSource aDataSource)
           
protected  javax.activation.ActivationDataFlavor getDataFlavor()
          Get the DataFlavor, lazily initialised if required.
 java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor aDataFlavor, javax.activation.DataSource aDataSource)
           
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
           
protected  void setDataFlavor(javax.activation.ActivationDataFlavor aDataFlavor)
           
protected  void updateDataFlavor()
          Update the current DataFlavor.
 
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
writeTo
 

Constructor Detail

AbstractDataContentHandler

public AbstractDataContentHandler()
Default Constructor

Method Detail

updateDataFlavor

protected void updateDataFlavor()
Update the current DataFlavor.


computeDataFlavor

protected abstract javax.activation.ActivationDataFlavor computeDataFlavor()
Compute an ActivationDataFlavor.

Returns:
A new ActivationDataFlavor

setDataFlavor

protected void setDataFlavor(javax.activation.ActivationDataFlavor aDataFlavor)

getContent

public java.lang.Object getContent(javax.activation.DataSource aDataSource)
                            throws java.io.IOException
Specified by:
getContent in interface javax.activation.DataContentHandler
Throws:
java.io.IOException
See Also:
DataContentHandler.getContent(javax.activation.DataSource)

computeContent

protected abstract java.lang.Object computeContent(javax.activation.DataSource aDataSource)
                                            throws javax.mail.MessagingException
Compute the content from aDataSource.

Parameters:
aDataSource -
Returns:
new Content built from the DataSource
Throws:
javax.mail.MessagingException

getTransferData

public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor aDataFlavor,
                                        javax.activation.DataSource aDataSource)
                                 throws java.awt.datatransfer.UnsupportedFlavorException,
                                        java.io.IOException
Specified by:
getTransferData in interface javax.activation.DataContentHandler
Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
See Also:
DataContentHandler.getTransferData(java.awt.datatransfer.DataFlavor, javax.activation.DataSource)

getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Specified by:
getTransferDataFlavors in interface javax.activation.DataContentHandler
See Also:
DataContentHandler.getTransferDataFlavors()

getDataFlavor

protected javax.activation.ActivationDataFlavor getDataFlavor()
Get the DataFlavor, lazily initialised if required.

Returns:
Returns the dataFlavor, lazily initialised.


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.