Contents | Package | Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS

Class javax.activation.ActivationDataFlavor

java.lang.Object
    |
    +----java.awt.datatransfer.DataFlavor
            |
            +----javax.activation.ActivationDataFlavor

public class ActivationDataFlavor
extends java.awt.datatransfer.DataFlavor
The ActivationDataFlavor is a special instance of the java.awt.datatransfer.DataFlavor. It allows the JAF to set all three values stored by the DataFlavor class via a new constructor as well as improved MIME parsing in the equals method. Besides the improved parsing, it's semantics are identical to that of the JDK's DataFlavor class.


Fields inherited from class java.awt.datatransfer.DataFlavor
 plainTextFlavor, stringFlavor
 

Constructor Summary
 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.Class representationClass, java.lang.String humanPresentableName)
Construct a DataFlavor that represents a MimeType.
 ActivationDataFlavor(java.lang.String mimeType, java.lang.String humanPresentableName)
Construct a DataFlavor that represents a MimeType.
 

Method Summary
boolean  equals(java.awt.datatransfer.DataFlavor dataFlavor)
Compares the DataFlavor passed in with this DataFlavor, calls this.isMimeTypeEqual.
java.lang.String  getHumanPresentableName()
Return the Human Presentable name
java.lang.String  getMimeType()
Returns the MIME type string 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.
java.lang.String  normalizeMimeType(java.lang.String mimeType)
Called for each MIME type string to give DataFlavor subtypes the opportunity to change how the normalization of MIME types is accomplished.
java.lang.String  normalizeMimeTypeParameter(java.lang.String parameterName, java.lang.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(java.lang.String humanPresentableName)
set the human presentable name
 
Methods inherited from class java.awt.datatransfer.DataFlavor
 clone, equals, equals, equals, equals, getHumanPresentableName, getMimeType, getParameter, getPrimaryType, getRepresentationClass, getSubType, isMimeTypeEqual, isMimeTypeEqual, isMimeTypeEqual, isMimeTypeSerializedObject, isRepresentationClassInputStream, isRepresentationClassSerializable, normalizeMimeType, normalizeMimeTypeParameter, readObject, setHumanPresentableName, writeObject
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivationDataFlavor

public ActivationDataFlavor(java.lang.Class representationClass,
                            java.lang.String mimeType,
                            java.lang.String humanPresentableName)
Construct a DataFlavor that represents an arbitrary Java object. This constructor is an extension of the JDK's DataFlavor in that it allows the explicit setting of all three DataFlavor attributes.

The returned DataFlavor will have the following characteristics:

representationClass = representationClass
mimeType = mimeType
humanName = humanName

Parameters:
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

ActivationDataFlavor

public ActivationDataFlavor(java.lang.Class representationClass,
                            java.lang.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


ActivationDataFlavor

public ActivationDataFlavor(java.lang.String mimeType,
                            java.lang.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

Method Detail

getMimeType

public java.lang.String getMimeType()
Returns the MIME type string for this DataFlavor
Overrides:
getMimeType in class java.awt.datatransfer.DataFlavor

getRepresentationClass

public java.lang.Class getRepresentationClass()
Return the representation class
Overrides:
getRepresentationClass in class java.awt.datatransfer.DataFlavor

getHumanPresentableName

public java.lang.String getHumanPresentableName()
Return the Human Presentable name
Overrides:
getHumanPresentableName in class java.awt.datatransfer.DataFlavor

setHumanPresentableName

public void setHumanPresentableName(java.lang.String humanPresentableName)
set the human presentable name
Overrides:
setHumanPresentableName in class java.awt.datatransfer.DataFlavor

equals

public boolean equals(java.awt.datatransfer.DataFlavor dataFlavor)
Compares the DataFlavor passed in with this DataFlavor, calls this.isMimeTypeEqual.
Overrides:
equals in class java.awt.datatransfer.DataFlavor

isMimeTypeEqual

public boolean isMimeTypeEqual(java.lang.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).

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.

Overrides:
isMimeTypeEqual in class java.awt.datatransfer.DataFlavor

normalizeMimeTypeParameter

protected java.lang.String normalizeMimeTypeParameter(java.lang.String parameterName,
                                            java.lang.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

Overrides:
normalizeMimeTypeParameter in class java.awt.datatransfer.DataFlavor

normalizeMimeType

protected java.lang.String normalizeMimeType(java.lang.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
Overrides:
normalizeMimeType in class java.awt.datatransfer.DataFlavor

Contents | Package | Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS