Class java.awt.datatransfer.DataFlavor
All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.datatransfer.DataFlavor
Object
|
+----java.awt.datatransfer.DataFlavor
- public class DataFlavor
- extends Object
Each instance represents the opaque concept of a data format as would
appear on a clipboard, during drag and drop, or in a file system.
- Version:
- 1.6, 07/01/98
- Author:
- Blake Sullivan
-
plainTextFlavor
- The DataFlavor representing plain text with unicode encoding, where:
representationClass = InputStream
mimeType = "text/plain; charset=unicode"
-
stringFlavor
- The DataFlavor representing a Java Unicode String class, where:
representationClass = java.lang.String
/**
The DataFlavor representing a Java Unicode String class, where:
representationClass = java.lang.String
mimeType = "application/x-java-serialized-object"
-
java.awt.datatransfer.DataFlavor(Class, String)
- Construct a DataFlavor that represents a Java class
The returned DataFlavor will have the following characteristics
representationClass = representationClass
mimeType = application/x-java-serialized-object
-
java.awt.datatransfer.DataFlavor(String, String)
- Construct a DataFlavor that represents a MimeType
The returned DataFlavor will have the following characteristics:
If the mimeType is
"application/x-java-serialized-object; class=",
the result is the same as calling
new DataFlavor(Class:forName() as above
otherwise:
representationClass = InputStream
mimeType = mimeType
-
equals(DataFlavor)
-
-
getHumanPresentableName()
- Returns the human presentable name for the data foramt that this
DataFlavor represents.
-
getMimeType()
- Returns the MIME type string for this DataFlavor
-
getRepresentationClass()
- Returns the Class which objects supporting this DataFlavor
will return when this DataFlavor is requested.
-
isMimeTypeEqual(String)
- Is the string representation of the MIME type passed in equivalent
to the MIME type of this DataFlavor.
-
isMimeTypeEqual(DataFlavor)
- Convenience function equivalent to calling:
isMimeTypeEqual(dataFlavor.getMimeType());
-
normalizeMimeType(String)
- Called for each MIME type string to give DataFlavor subtypes the
opportunity to change how the normalization of MIME types is accomplished.
-
normalizeMimeTypeParameter(String, String)
- Called on DataFlavor for every MIME Type parameter to allow DataFlavor
subclasses to handle special parameters like the text/plain charset
parameters, whose values are case insensitive.
-
setHumanPresentableName(String)
- Sets the human presentable name for the data format that this
DataFlavor represents.
plainTextFlavor
public static final java.awt.datatransfer.DataFlavor plainTextFlavor
- The DataFlavor representing plain text with unicode encoding, where:
representationClass = InputStream
mimeType = "text/plain; charset=unicode"
stringFlavor
public static final java.awt.datatransfer.DataFlavor stringFlavor
- The DataFlavor representing a Java Unicode String class, where:
representationClass = java.lang.String
/**
The DataFlavor representing a Java Unicode String class, where:
representationClass = java.lang.String
mimeType = "application/x-java-serialized-object"
DataFlavor
public DataFlavor(Class representationClass,
String humanPresentableName)
- Construct a DataFlavor that represents a Java class
The returned DataFlavor will have the following characteristics
representationClass = representationClass
mimeType = application/x-java-serialized-object
- Parameters:
- representationClass - the class used to transfer data in this flavor
- humanPresentableName - the human-readible string used to identify this flavor
DataFlavor
public DataFlavor(String mimeType,
String humanPresentableName)
- Construct a DataFlavor that represents a MimeType
The returned DataFlavor will have the following characteristics:
If the mimeType is
"application/x-java-serialized-object; class=",
the result is the same as calling
new DataFlavor(Class:forName() as above
otherwise:
representationClass = InputStream
mimeType = mimeType
- Parameters:
- mimeType - the string used to identify the MIME type for this flavor
- humanPresentableName - the human-readible string used to identify this flavor
equals
public boolean equals(DataFlavor dataFlavor)
getHumanPresentableName
public java.lang.String getHumanPresentableName()
- Returns the human presentable name for the data foramt that this
DataFlavor represents. This name would be localized for different
countries
getMimeType
public java.lang.String getMimeType()
- Returns the MIME type string for this DataFlavor
getRepresentationClass
public java.lang.Class getRepresentationClass()
- Returns the Class which objects supporting this DataFlavor
will return when this DataFlavor is requested.
isMimeTypeEqual
public boolean isMimeTypeEqual(String mimeType)
- Is the string representation of the MIME type passed in equivalent
to the MIME type of this DataFlavor. This may involve adding default
attributes for some MIME types (like adding charset=US-ASCII to
text/plain MIME types that have no charset parameter specified)
isMimeTypeEqual
public final boolean isMimeTypeEqual(DataFlavor dataFlavor)
- Convenience function equivalent to calling:
isMimeTypeEqual(dataFlavor.getMimeType());
normalizeMimeType
protected java.lang.String normalizeMimeType(String mimeType)
- Called for each MIME type string to give DataFlavor subtypes the
opportunity to change how the normalization of MIME types is accomplished.
One possible use would be to add default parameter/value pairs in cases
where none are present in the MIME type string passed in
normalizeMimeTypeParameter
protected java.lang.String normalizeMimeTypeParameter(String parameterName,
String parameterValue)
- Called on DataFlavor for every MIME Type parameter to allow DataFlavor
subclasses to handle special parameters like the text/plain charset
parameters, whose values are case insensitive. (MIME type parameter
values are supposed to be case sensitive.
This method is called for each parameter name/value pair and should
return the normalized representation of the parameterValue
setHumanPresentableName
public void setHumanPresentableName(String humanPresentableName)
- Sets the human presentable name for the data format that this
DataFlavor represents. This name would be localized for different
countries
All Packages Class Hierarchy This Package Previous Next Index