public class ActivationDataFlavor extends DataFlavor
java.awt.datatransfer.DataFlavor. It allows the JAF to set all three values stored by the DataFlavor class via a new constructor. It also contains improved MIME parsing in the
equals method. Except for the improved parsing, its semantics are identical to that of the JDK's DataFlavor class.
allHtmlFlavor, fragmentHtmlFlavor, imageFlavor, javaFileListFlavor, javaJVMLocalObjectMimeType, javaRemoteObjectMimeType, javaSerializedObjectMimeType, plainTextFlavor, selectionHtmlFlavor, stringFlavor| Constructor and Description |
|---|
ActivationDataFlavor(Class
Construct a DataFlavor that represents a MimeType.
|
ActivationDataFlavor(Class
Construct a DataFlavor that represents an arbitrary Java object.
|
ActivationDataFlavor(String
Construct a DataFlavor that represents a MimeType.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(DataFlavor
Compares the DataFlavor passed in with this DataFlavor; calls the
isMimeTypeEqual method.
|
String |
getHumanPresentableName()
Return the Human Presentable name.
|
String |
getMimeType()
Return the MIME type for this DataFlavor.
|
Class |
getRepresentationClass()
Return the representation class.
|
boolean |
isMimeTypeEqual(String
Is the string representation of the MIME type passed in equivalent to the MIME type of this DataFlavor.
|
protected String |
normalizeMimeType(String
Deprecated.
|
protected String |
normalizeMimeTypeParameter(String
Deprecated.
|
void |
setHumanPresentableName(String
Set the human presentable name.
|
clone, equals, equals, getDefaultRepresentationClass, getDefaultRepresentationClassAsString, getParameter, getPrimaryType, getReaderForText, getSubType, getTextPlainUnicodeFlavor, hashCode, isFlavorJavaFileListType, isFlavorRemoteObjectType, isFlavorSerializedObjectType, isFlavorTextType, isMimeTypeEqual, isMimeTypeSerializedObject, isRepresentationClassByteBuffer, isRepresentationClassCharBuffer, isRepresentationClassInputStream, isRepresentationClassReader, isRepresentationClassRemote, isRepresentationClassSerializable, match, readExternal, selectBestTextFlavor, toString, tryToLoadClass, writeExternalpublic ActivationDataFlavor(ClassrepresentationClass, String mimeType, String humanPresentableName)
The returned DataFlavor will have the following characteristics:
representationClass = representationClass
mimeType = mimeType
humanName = humanName
representationClass - the class used in this DataFlavor
mimeType - the MIME type of the data represented by this class
humanPresentableName - the human presentable name of the flavor
public ActivationDataFlavor(ClassrepresentationClass, String humanPresentableName)
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
representationClass - the class used in this DataFlavor
humanPresentableName - the human presentable name of the flavor
public ActivationDataFlavor(StringmimeType, String humanPresentableName)
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
mimeType - the MIME type of the data represented by this class
humanPresentableName - the human presentable name of the flavor
public StringgetMimeType()
getMimeType in class
DataFlavor
public ClassgetRepresentationClass()
getRepresentationClass in class
DataFlavor
public StringgetHumanPresentableName()
getHumanPresentableName in class
DataFlavor
public void setHumanPresentableName(StringhumanPresentableName)
setHumanPresentableName in class
DataFlavor
humanPresentableName - the name to set
public boolean equals(DataFlavordataFlavor)
isMimeTypeEqual method.
equals in class
DataFlavor
dataFlavor - the DataFlavor to compare with
DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[])
public boolean isMimeTypeEqual(StringmimeType)
ActivationDataFlavor delegates the comparison of MIME types to the MimeType class included as part of the JavaBeans Activation Framework. This provides a more robust comparison than is normally available in the DataFlavor class.
isMimeTypeEqual in class
DataFlavor
mimeType - the MIME type
protected StringnormalizeMimeTypeParameter(String parameterName, String parameterValue)
This method is called for each parameter name/value pair and should return the normalized representation of the parameterValue. This method is never invoked by this implementation.
normalizeMimeTypeParameter in class
DataFlavor
parameterName - the parameter name
parameterValue - the parameter value
protected StringnormalizeMimeType(String mimeType)
normalizeMimeType in class
DataFlavor
mimeType - the MIME type