Class: javax.activation.ActivationDataFlavor

  • public class ActivationDataFlavor
  • extends DataFlavor
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.
Since:
@since 1.6

Inheritance

Superclass tree: Implements:

Methods

  • ActivationDataFlavortop

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

    Parameters:
    @param representationClass the class used in this DataFlavor
    @param humanPresentableName the human presentable name of the flavor
    Google Code Search
    Stack Overflow
  • ActivationDataFlavortop

    public ActivationDataFlavor(Class representationClass, String mimeType, 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:
    @param representationClass the class used in this DataFlavor
    @param mimeType the MIME type of the data represented by this class
    @param humanPresentableName the human presentable name of the flavor
    Google Code Search
    Stack Overflow
  • ActivationDataFlavortop

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

    Parameters:
    @param mimeType the MIME type of the data represented by this class
    @param humanPresentableName the human presentable name of the flavor
    Google Code Search
    Stack Overflow
  • equalstop

    public boolean equals(DataFlavor dataFlavor)
    Compares the DataFlavor passed in with this DataFlavor; calls the isMimeTypeEqual method.
    Parameters:
    @param dataFlavor the DataFlavor to compare with
    Return:
    @return true if the MIME type and representation class are the same
    Override hierarchy:
    equals from DataFlavor
    Google Code Search
    Stack Overflow
  • getHumanPresentableNametop

    public String getHumanPresentableName()
    Return the Human Presentable name.
    Return:
    @return the human presentable name
    Override hierarchy:
    getHumanPresentableName from DataFlavor
    Google Code Search
    Stack Overflow
  • getMimeTypetop

    public String getMimeType()
    Return the MIME type for this DataFlavor.
    Return:
    @return the MIME type
    Override hierarchy:
    getMimeType from DataFlavor
    Google Code Search
    Stack Overflow
  • getRepresentationClasstop

    public Class getRepresentationClass()
    Return the representation class.
    Return:
    @return the representation class
    Override hierarchy:
    getRepresentationClass from DataFlavor
    Google Code Search
    Stack Overflow
  • isMimeTypeEqualtop

    public boolean isMimeTypeEqual(String mimeType)
    Is the string representation of the MIME type passed in equivalent to the MIME type of this DataFlavor.

    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.

    Parameters:
    @param mimeType the MIME type
    Return:
    @return true if the same MIME type
    Override hierarchy:
    isMimeTypeEqual from DataFlavor
    Google Code Search
    Stack Overflow
  • normalizeMimeTypetop

    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. One possible use would be to add default parameter/value pairs in cases where none are present in the MIME type string passed in. This method is never invoked by this implementation.
    Parameters:
    @param mimeType the MIME type
    Return:
    @return the normalized MIME type
    Deprecated:
    @deprecated
    Override hierarchy:
    normalizeMimeType from DataFlavor
    Google Code Search
    Stack Overflow
  • normalizeMimeTypeParametertop

    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. (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. This method is never invoked by this implementation.

    Parameters:
    @param parameterName the parameter name
    @param parameterValue the parameter value
    Return:
    @return the normalized parameter value
    Deprecated:
    @deprecated
    Override hierarchy:
    normalizeMimeTypeParameter from DataFlavor
    Google Code Search
    Stack Overflow
  • setHumanPresentableNametop

    public void setHumanPresentableName(String humanPresentableName)
    Set the human presentable name.
    Parameters:
    @param humanPresentableName the name to set
    Override hierarchy:
    setHumanPresentableName from DataFlavor
    Google Code Search
    Stack Overflow

Fields

  • humanPresentableName

    private String humanPresentableName
  • mimeObject

    private MimeType mimeObject
  • mimeType

    private String mimeType
  • representationClass

    private Class representationClass