Top Fields Constructors Methods
javax.activation

pack-priv Class ObjectDataContentHandler

Located in compilation unit of javax.activation.DataHandler.

extends Object
implements DataContentHandler
Class Inheritance
All Implemented Interfaces
javax.activation.DataContentHandler

Field Summary

Modifier and TypeField and Description
private DataContentHandler
private String
private Object
private DataFlavor[]

Constructor Summary

AccessConstructor and Description
public
ObjectDataContentHandler(DataContentHandler dch, Object obj, String mimeType)

The constructor.

Method Summary

Modifier and TypeMethod and Description
public Object
getContent(DataSource
The DataSource representing the data to be converted.
ds
)

Implements javax.activation.DataContentHandler.getContent.

Return an object representing the data in its most preferred form.
public DataContentHandler
getDCH()

Return the DataContentHandler for this object.

public Object

Returns:

the constructed Object
getTransferData
(DataFlavor
the DataFlavor
df
,
DataSource
the DataSource
ds
)

Implements javax.activation.DataContentHandler.getTransferData.

Return the Transfer Data of type DataFlavor from InputStream.
public synchronized DataFlavor[]

Returns:

the DataFlavors
getTransferDataFlavors
()

Implements javax.activation.DataContentHandler.getTransferDataFlavors.

Return the DataFlavors for this DataContentHandler.
public void
writeTo(Object
The object to be converted.
obj
,
String
The requested MIME type of the resulting byte stream.
mimeType
,
OutputStream
The output stream into which to write the converted byte stream.
os
)

Implements javax.activation.DataContentHandler.writeTo.

Write the object to the output stream.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dchback to summary
private DataContentHandler dch
mimeTypeback to summary
private String mimeType
objback to summary
private Object obj
transferFlavorsback to summary
private DataFlavor[] transferFlavors

Constructor Detail

ObjectDataContentHandlerback to summary
public ObjectDataContentHandler(DataContentHandler dch, Object obj, String mimeType)

The constructor.

Method Detail

getContentback to summary
public Object getContent(DataSource ds)

Implements javax.activation.DataContentHandler.getContent.

Doc from javax.activation.DataContentHandler.getContent.

Return an object representing the data in its most preferred form. Generally this will be the form described by the first DataFlavor returned by the getTransferDataFlavors method.

Parameters
ds:DataSource

The DataSource representing the data to be converted.

Returns:Object

The constructed Object.

getDCHback to summary
public DataContentHandler getDCH()

Return the DataContentHandler for this object. Used only by the DataHandler class.

getTransferDataback to summary
public Object getTransferData(DataFlavor df, DataSource ds) throws UnsupportedFlavorException, IOException

Implements javax.activation.DataContentHandler.getTransferData.

Return the Transfer Data of type DataFlavor from InputStream.

Parameters
df:DataFlavor

the DataFlavor

ds:DataSource

the DataSource

Returns:Object

the constructed Object

Exceptions
UnsupportedFlavorException:

Doc from javax.activation.DataContentHandler.getTransferData.

if the handler doesn't support the requested flavor

IOException:

Doc from javax.activation.DataContentHandler.getTransferData.

if the data can't be accessed

getTransferDataFlavorsback to summary
public synchronized DataFlavor[] getTransferDataFlavors()

Implements javax.activation.DataContentHandler.getTransferDataFlavors.

Return the DataFlavors for this DataContentHandler.

Returns:DataFlavor[]

the DataFlavors

writeToback to summary
public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException

Implements javax.activation.DataContentHandler.writeTo.

Write the object to the output stream.

Parameters
obj:Object

Doc from javax.activation.DataContentHandler.writeTo.

The object to be converted.

mimeType:String

Doc from javax.activation.DataContentHandler.writeTo.

The requested MIME type of the resulting byte stream.

os:OutputStream

Doc from javax.activation.DataContentHandler.writeTo.

The output stream into which to write the converted byte stream.

Exceptions
IOException:

Doc from javax.activation.DataContentHandler.writeTo.

errors writing to the stream