Returns an object that represents the data to be transferred. The class of the object returned is defined by the representation class of the data flavor.
For DataHandler's created with DataSources or URLs:
The DataHandler attempts to locate a DataContentHandler
for this MIME type. If one is found, the passed in DataFlavor
and the type of the data are passed to its getTransferData
method. If the DataHandler fails to locate a DataContentHandler
and the flavor specifies this object's MIME type and the
java.io.InputStream class, this object's InputStream
is returned.
Otherwise it throws an UnsupportedFlavorException.
For DataHandler's created with Objects:
The DataHandler attempts to locate a DataContentHandler for this MIME type. If one is found, the passed in DataFlavor and the type of the data are passed to its getTransferData method. If the DataHandler fails to locate a DataContentHandler and the flavor specifies this object's MIME type and its class, this DataHandler's referenced object is returned. Otherwise it throws an UnsupportedFlavorException.
flavor | the requested flavor for the data |
UnsupportedFlavorException | if the data could not be converted to the requested flavor | |
IOException | if an I/O error occurs |
javax.activation.ActivationDataFlavor
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.
The DataHandler attempts to find a DataContentHandler that
corresponds to the MIME type of the data. If one is located,
the DataHandler calls the DataContentHandler's
getTransferDataFlavors method.
If a DataContentHandler can not be located, and if the
DataHandler was created with a DataSource (or URL), one
DataFlavor is returned that represents this object's MIME type
and the java.io.InputStream class. If the
DataHandler was created with an object and a MIME type,
getTransferDataFlavors returns one DataFlavor that represents
this object's MIME type and the object's class.
javax.activation.DataContentHandler.getTransferDataFlavors
Returns whether the specified data flavor is supported for this object.
This method iterates through the DataFlavors returned from
getTransferDataFlavors, comparing each with
the specified flavor.
flavor | the requested flavor for the data |
javax.activation.DataHandler.getTransferDataFlavors
Diagram: Data