
Returns the
Transferable's data in the requested
DataFlavor if possible. If the desired flavor is
DataFlavor.stringFlavor, or an equivalent flavor,
the
String representing the selection is
returned. If the desired flavor is
DataFlavor.plainTextFlavor,
or an equivalent flavor, a
Reader is returned.
Note: The behavior of this method for
DataFlavor.plainTextFlavor and equivalent
DataFlavors is inconsistent with the
definition of
DataFlavor.plainTextFlavor.
Returns:
the data in the requested flavor, as outlined above
Parameters:
-
flavor - the requested flavor for the data
Throws:
-
UnsupportedFlavorException - if the requested data flavor is
not equivalent to either
DataFlavor.stringFlavor
or
DataFlavor.plainTextFlavor
-
IOException - if an IOException occurs while retrieving the data.
By default, StringSelection never throws this exception, but a
subclass may.
-
NullPointerException - if flavor is
null
See Also:
Reader,