Top Fields Constructors Methods
jakarta.activation

pack-priv Class ObjectDataContentHandler

Located in compilation unit of jakarta.activation.DataHandler.

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

Field Summary

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

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 jakarta.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
(ActivationDataFlavor
the ActivationDataFlavor
df
,
DataSource
the DataSource
ds
)

Implements jakarta.activation.DataContentHandler.getTransferData.

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

Returns:

the ActivationDataFlavors
getTransferDataFlavors
()

Implements jakarta.activation.DataContentHandler.getTransferDataFlavors.

Return the ActivationDataFlavors 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 jakarta.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 ActivationDataFlavor[] 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 jakarta.activation.DataContentHandler.getContent.

Doc from jakarta.activation.DataContentHandler.getContent.

Return an object representing the data in its most preferred form. Generally this will be the form described by the first ActivationDataFlavor 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(ActivationDataFlavor df, DataSource ds) throws IOException

Implements jakarta.activation.DataContentHandler.getTransferData.

Return the Transfer Data of type ActivationDataFlavor from InputStream.

Parameters
df:ActivationDataFlavor

the ActivationDataFlavor

ds:DataSource

the DataSource

Returns:Object

the constructed Object

Exceptions
IOException:

Doc from jakarta.activation.DataContentHandler.getTransferData.

  • if the handler doesn't support the requested flavor
  • if the data can't be accessed
getTransferDataFlavorsback to summary
public synchronized ActivationDataFlavor[] getTransferDataFlavors()

Implements jakarta.activation.DataContentHandler.getTransferDataFlavors.

Return the ActivationDataFlavors for this DataContentHandler.

Returns:ActivationDataFlavor[]

the ActivationDataFlavors

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

Implements jakarta.activation.DataContentHandler.writeTo.

Write the object to the output stream.

Parameters
obj:Object

Doc from jakarta.activation.DataContentHandler.writeTo.

The object to be converted.

mimeType:String

Doc from jakarta.activation.DataContentHandler.writeTo.

The requested MIME type of the resulting byte stream.

os:OutputStream

Doc from jakarta.activation.DataContentHandler.writeTo.

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

Exceptions
IOException:

Doc from jakarta.activation.DataContentHandler.writeTo.

errors writing to the stream