javax.activation
Class ActivationDataFlavor

java.lang.Object
  extended by java.awt.datatransfer.DataFlavor
      extended by javax.activation.ActivationDataFlavor
All Implemented Interfaces:
Externalizable, Serializable, Cloneable

public class ActivationDataFlavor
extends DataFlavor

Activation-specific DataFlavor with improved MIME parsing.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.datatransfer.DataFlavor
imageFlavor, javaFileListFlavor, javaJVMLocalObjectMimeType, javaRemoteObjectMimeType, javaSerializedObjectMimeType, plainTextFlavor, stringFlavor
 
Constructor Summary
ActivationDataFlavor(Class representationClass, String humanPresentableName)
          Constructor.
ActivationDataFlavor(Class representationClass, String mimeType, String humanPresentableName)
          Constructor.
ActivationDataFlavor(String mimeType, String humanPresentableName)
          Constructor.
 
Method Summary
 boolean equals(DataFlavor dataFlavor)
          This method test the specified DataFlavor for equality against this object.
 String getHumanPresentableName()
          Returns the human presentable name for this flavor.
 String getMimeType()
          Returns the MIME type of this flavor.
 Class getRepresentationClass()
          Returns the representation class for this flavor.
 boolean isMimeTypeEqual(String mimeType)
          Tests the MIME type of this object for equality against the specified MIME type.
protected  String normalizeMimeType(String mimeType)
          This method exists for backward compatibility.
protected  String normalizeMimeTypeParameter(String parameterName, String parameterValue)
          This method exists for backward compatibility.
 void setHumanPresentableName(String humanPresentableName)
          Sets the human presentable name to the specified value.
 
Methods inherited from class java.awt.datatransfer.DataFlavor
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, writeExternal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActivationDataFlavor

public ActivationDataFlavor(Class representationClass,
                            String mimeType,
                            String humanPresentableName)
Constructor.

Parameters:
representationClass - the representation class
mimeType - the MIME type of the data
humanPresentableName - the human-presentable name of the data flavor

ActivationDataFlavor

public ActivationDataFlavor(Class representationClass,
                            String humanPresentableName)
Constructor.

Parameters:
representationClass - the representation class
humanPresentableName - the human-presentable name of the data flavor

ActivationDataFlavor

public ActivationDataFlavor(String mimeType,
                            String humanPresentableName)
Constructor. The representation class is an InputStream.

Parameters:
mimeType - the MIME type of the data
humanPresentableName - the human-presentable name of the data flavor
Method Detail

getMimeType

public String getMimeType()
Description copied from class: DataFlavor
Returns the MIME type of this flavor.

Overrides:
getMimeType in class DataFlavor
Returns:
The MIME type for this flavor.

getRepresentationClass

public Class getRepresentationClass()
Description copied from class: DataFlavor
Returns the representation class for this flavor.

Overrides:
getRepresentationClass in class DataFlavor
Returns:
The representation class for this flavor.

getHumanPresentableName

public String getHumanPresentableName()
Description copied from class: DataFlavor
Returns the human presentable name for this flavor.

Overrides:
getHumanPresentableName in class DataFlavor
Returns:
The human presentable name for this flavor.

setHumanPresentableName

public void setHumanPresentableName(String humanPresentableName)
Description copied from class: DataFlavor
Sets the human presentable name to the specified value.

Overrides:
setHumanPresentableName in class DataFlavor
Parameters:
humanPresentableName - The new display name.

equals

public boolean equals(DataFlavor dataFlavor)
Description copied from class: DataFlavor
This method test the specified DataFlavor for equality against this object. This will be true if the MIME type and representation class are the equal. If the primary type is 'text' then also the value of the charset parameter is compared. In such a case when the charset parameter isn't given then the charset is assumed to be equal to the default charset of the platform. All other parameters are ignored.

Overrides:
equals in class DataFlavor
Parameters:
dataFlavor - The DataFlavor to test against.
Returns:
true if the flavor is equal to this object, false otherwise.

isMimeTypeEqual

public boolean isMimeTypeEqual(String mimeType)
Description copied from class: DataFlavor
Tests the MIME type of this object for equality against the specified MIME type. Ignores parameters.

Overrides:
isMimeTypeEqual in class DataFlavor
Parameters:
mimeType - The MIME type to test against.
Returns:
true if the MIME type is equal to this object's MIME type (ignoring parameters), false otherwise.

normalizeMimeTypeParameter

protected String normalizeMimeTypeParameter(String parameterName,
                                            String parameterValue)
Description copied from class: DataFlavor
This method exists for backward compatibility. It simply returns the same name/value pair passed in.

Overrides:
normalizeMimeTypeParameter in class DataFlavor
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value.
Returns:
The name/value pair.

normalizeMimeType

protected String normalizeMimeType(String mimeType)
Description copied from class: DataFlavor
This method exists for backward compatibility. It simply returns the MIME type string unchanged.

Overrides:
normalizeMimeType in class DataFlavor
Parameters:
mimeType - The MIME type.
Returns:
The MIME type.