net.sourceforge.mflow.api
Interface ContentHandler

All Known Implementing Classes:
ContentHandlerImpl

public interface ContentHandler

A JavaBean compliant wrapper for a DataHandler

Version:
$Revision: 1.3 $
Author:
David Carr

Method Summary
 java.lang.Object getContent()
          Returns the data in its preferred Object form.
 java.lang.String getContentType()
          Return the MIME type of this object as retrieved from the source object.
 javax.activation.DataHandler getDataHandler()
          Returns the internal DataHandler
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
          Return the DataFlavors in which this data is available.
 void setContent(java.lang.Object o)
          Replaces the internal DataHandler with one using the specified content Object
 void setContentType(java.lang.String mimeType)
          Replaces the internal DataHandler with one using the specified MIME type
 

Method Detail

getContent

java.lang.Object getContent()
Returns the data in its preferred Object form.

If the DataHandler was instantiated with an object, return the object.

If the DataHandler was instantiated with a DataSource, attempt to use a DataContentHandler to return an object. If no appropriate DataContentHandler can be found, get an InputStream from the DataHandler and return a byte[].

On error, return null.

Returns:
the content, or null on error.

getContentType

java.lang.String getContentType()
Return the MIME type of this object as retrieved from the source object. Note that this is the full type with parameters.

Returns:
the MIME type

setContentType

void setContentType(java.lang.String mimeType)
Replaces the internal DataHandler with one using the specified MIME type

Parameters:
mimeType - the new MIME type

setContent

void setContent(java.lang.Object o)
Replaces the internal DataHandler with one using the specified content Object

Parameters:
o - the new content Object

getDataHandler

javax.activation.DataHandler getDataHandler()
Returns the internal DataHandler

Returns:
the DataHandler wrapped by this class

getTransferDataFlavors

java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Return the DataFlavors in which this data is available.

Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array is usually ordered according to preference for providing the data, from most richly descriptive to least richly descriptive.

Returns:
an array of data flavors in which this data can be transferred
See Also:
Transferable.getTransferDataFlavors()


Copyright © 2002-2004 MFlow Group. All Rights Reserved.