|
JavaTM 2 Platform Ent. Ed. v1.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.datatransfer.DataFlavor javax.activation.ActivationDataFlavor
The ActivationDataFlavor class is a special subclass of
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.
Field Summary |
Fields inherited from class java.awt.datatransfer.DataFlavor |
imageFlavor, javaFileListFlavor, javaJVMLocalObjectMimeType, javaRemoteObjectMimeType, javaSerializedObjectMimeType, plainTextFlavor, stringFlavor |
Constructor Summary | |
ActivationDataFlavor(Class representationClass,
String humanPresentableName)
Construct a DataFlavor that represents a MimeType. |
|
ActivationDataFlavor(Class representationClass,
String mimeType,
String humanPresentableName)
Construct a DataFlavor that represents an arbitrary Java object. |
|
ActivationDataFlavor(String mimeType,
String humanPresentableName)
Construct a DataFlavor that represents a MimeType. |
Method Summary | |
boolean |
equals(DataFlavor 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 mimeType)
Is the string representation of the MIME type passed in equivalent to the MIME type of this DataFlavor. |
protected 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. |
protected 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. |
void |
setHumanPresentableName(String humanPresentableName)
Set the human presentable name. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ActivationDataFlavor(Class representationClass, String mimeType, 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(Class representationClass, 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(String mimeType, 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 flavorMethod Detail |
public String getMimeType()
public Class getRepresentationClass()
public String getHumanPresentableName()
public void setHumanPresentableName(String humanPresentableName)
humanPresentableName
- the name to setpublic boolean equals(DataFlavor dataFlavor)
isMimeTypeEqual
method.
dataFlavor
- the DataFlavor to compare with
public boolean isMimeTypeEqual(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.
mimeType
- the MIME type
protected String normalizeMimeTypeParameter(String parameterName, String parameterValue)
This method is called for each parameter name/value pair and should return the normalized representation of the parameterValue.
parameterName
- the parameter nameparameterValue
- the parameter value
protected String normalizeMimeType(String mimeType)
mimeType
- the MIME type
|
JavaTM 2 Platform Ent. Ed. v1.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2003 Sun Microsystems, Inc. All rights reserved.