public class ActivationDataFlavor
extends java.awt.datatransfer.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.| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
humanPresentableName |
private MimeType |
mimeObject |
private java.lang.String |
mimeType |
private java.lang.Class |
representationClass |
| Constructor and Description |
|---|
ActivationDataFlavor(java.lang.Class representationClass,
java.lang.String humanPresentableName)
Construct a DataFlavor that represents a MimeType.
|
ActivationDataFlavor(java.lang.Class representationClass,
java.lang.String mimeType,
java.lang.String humanPresentableName)
Construct a DataFlavor that represents an arbitrary
Java object.
|
ActivationDataFlavor(java.lang.String mimeType,
java.lang.String humanPresentableName)
Construct a DataFlavor that represents a MimeType.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.awt.datatransfer.DataFlavor dataFlavor)
Compares the DataFlavor passed in with this DataFlavor; calls
the
isMimeTypeEqual method. |
java.lang.String |
getHumanPresentableName()
Return the Human Presentable name.
|
java.lang.String |
getMimeType()
Return the MIME type for this DataFlavor.
|
java.lang.Class |
getRepresentationClass()
Return the representation class.
|
boolean |
isMimeTypeEqual(java.lang.String mimeType)
Is the string representation of the MIME type passed in equivalent
to the MIME type of this DataFlavor.
|
protected java.lang.String |
normalizeMimeType(java.lang.String mimeType)
Deprecated.
|
protected java.lang.String |
normalizeMimeTypeParameter(java.lang.String parameterName,
java.lang.String parameterValue)
Deprecated.
|
void |
setHumanPresentableName(java.lang.String humanPresentableName)
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, writeExternalprivate java.lang.String mimeType
private MimeType mimeObject
private java.lang.String humanPresentableName
private java.lang.Class representationClass
public ActivationDataFlavor(java.lang.Class representationClass,
java.lang.String mimeType,
java.lang.String humanPresentableName)
The returned DataFlavor will have the following characteristics:
representationClass = representationClass
mimeType = mimeType
humanName = humanName
representationClass - the class used in this DataFlavormimeType - the MIME type of the data represented by this classhumanPresentableName - the human presentable name of the flavorpublic ActivationDataFlavor(java.lang.Class representationClass,
java.lang.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 DataFlavorhumanPresentableName - the human presentable name of the flavorpublic ActivationDataFlavor(java.lang.String mimeType,
java.lang.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 classhumanPresentableName - the human presentable name of the flavorpublic java.lang.String getMimeType()
getMimeType in class java.awt.datatransfer.DataFlavorpublic java.lang.Class getRepresentationClass()
getRepresentationClass in class java.awt.datatransfer.DataFlavorpublic java.lang.String getHumanPresentableName()
getHumanPresentableName in class java.awt.datatransfer.DataFlavorpublic void setHumanPresentableName(java.lang.String humanPresentableName)
setHumanPresentableName in class java.awt.datatransfer.DataFlavorhumanPresentableName - the name to setpublic boolean equals(java.awt.datatransfer.DataFlavor dataFlavor)
isMimeTypeEqual method.equals in class java.awt.datatransfer.DataFlavordataFlavor - the DataFlavor to compare withpublic boolean isMimeTypeEqual(java.lang.String mimeType)
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 java.awt.datatransfer.DataFlavormimeType - the MIME typeprotected java.lang.String normalizeMimeTypeParameter(java.lang.String parameterName,
java.lang.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 java.awt.datatransfer.DataFlavorparameterName - the parameter nameparameterValue - the parameter valueprotected java.lang.String normalizeMimeType(java.lang.String mimeType)
normalizeMimeType in class java.awt.datatransfer.DataFlavormimeType - the MIME type