java.lang.Object
jakarta.activation.ObjectDataContentHandler
- All Implemented Interfaces:
DataContentHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DataContentHandlerprivate Stringprivate Objectprivate ActivationDataFlavor[] -
Constructor Summary
ConstructorsConstructorDescriptionObjectDataContentHandler(DataContentHandler dch, Object obj, String mimeType) The constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetContent(DataSource ds) Return an object representing the data in its most preferred form.getDCH()Return the DataContentHandler for this object.Return the Transfer Data of type ActivationDataFlavor from InputStream.Return the ActivationDataFlavors for thisDataContentHandler.voidwriteTo(Object obj, String mimeType, OutputStream os) Write the object to the output stream.
-
Field Details
-
transferFlavors
-
obj
-
mimeType
-
dch
-
-
Constructor Details
-
ObjectDataContentHandler
The constructor.
-
-
Method Details
-
getDCH
Return the DataContentHandler for this object. Used only by the DataHandler class. -
getTransferDataFlavors
Return the ActivationDataFlavors for thisDataContentHandler.- Specified by:
getTransferDataFlavorsin interfaceDataContentHandler- Returns:
- the ActivationDataFlavors
-
getTransferData
Return the Transfer Data of type ActivationDataFlavor from InputStream.- Specified by:
getTransferDatain interfaceDataContentHandler- Parameters:
df- the ActivationDataFlavords- the DataSource- Returns:
- the constructed Object
- Throws:
IOException- if the handler doesn't support the requested flavorIOException- if the data can't be accessed
-
getContent
Description copied from interface:DataContentHandlerReturn an object representing the data in its most preferred form. Generally this will be the form described by the first ActivationDataFlavor returned by thegetTransferDataFlavorsmethod.- Specified by:
getContentin interfaceDataContentHandler- Parameters:
ds- The DataSource representing the data to be converted.- Returns:
- The constructed Object.
-
writeTo
Write the object to the output stream.- Specified by:
writeToin interfaceDataContentHandler- Parameters:
obj- The object to be converted.mimeType- The requested MIME type of the resulting byte stream.os- The output stream into which to write the converted byte stream.- Throws:
IOException- errors writing to the stream
-