net.sourceforge.mflow.impl
Class ContentHandlerImpl

java.lang.Object
  extended bynet.sourceforge.mflow.impl.ContentHandlerImpl
All Implemented Interfaces:
ContentHandler

public class ContentHandlerImpl
extends java.lang.Object
implements ContentHandler

A JavaBean compliant wrapper for a DataHandler

Version:
$Revision: 1.4 $
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getContent

public java.lang.Object getContent()
Description copied from interface: ContentHandler
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.

Specified by:
getContent in interface ContentHandler
Returns:
the content, or null on error.

getContentType

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

Specified by:
getContentType in interface ContentHandler
Returns:
the MIME type

setContentType

public void setContentType(java.lang.String mimeType)
Description copied from interface: ContentHandler
Replaces the internal DataHandler with one using the specified MIME type

Specified by:
setContentType in interface ContentHandler
Parameters:
mimeType - the new MIME type

setContent

public void setContent(java.lang.Object o)
Description copied from interface: ContentHandler
Replaces the internal DataHandler with one using the specified content Object

Specified by:
setContent in interface ContentHandler
Parameters:
o - the new content Object

getDataHandler

public javax.activation.DataHandler getDataHandler()
Description copied from interface: ContentHandler
Returns the internal DataHandler

Specified by:
getDataHandler in interface ContentHandler
Returns:
the DataHandler wrapped by this class

getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Description copied from interface: ContentHandler
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.

Specified by:
getTransferDataFlavors in interface ContentHandler
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.