API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt.datatransfer. DataFlavor View Source
Author(s)
Blake Sullivan
Laurence P. G. Cable
Jeff Dunn
Since
Version
1.83, 07/28/06
Serial
Hierarchy
 Object
      DataFlavor
Implements
 Externalizable
 Cloneable
Subclasses
Description
public class DataFlavor
  A DataFlavor provides meta information about data.
See also:   
Constructors
public DataFlavor ()
  Constructs a new DataFlavor.
public DataFlavor (Class<Object> representationClass, String humanPresentableName)
  Constructs a DataFlavor that represents a Java class.
public DataFlavor (String mimeType) throws ClassNotFoundException
  Constructs a DataFlavor from a mimeType string.
public DataFlavor (String mimeType, String humanPresentableName)
  Constructs a DataFlavor that represents a MimeType.
public DataFlavor (String mimeType, String humanPresentableName, ClassLoader classLoader) throws ClassNotFoundException
  Constructs a DataFlavor that represents a MimeType.
private DataFlavor (String primaryType, String subType, MimeTypeParameterList params, Class representationClass, String humanPresentableName)
  Constructs a fully specified DataFlavor.
Methods
Hide/Show inherited methods
public Object clone () throws CloneNotSupportedException
  Returns a clone of this DataFlavor.
public boolean equals (DataFlavor that)
  Tests a DataFlavor to this DataFlavor for equality.
public boolean equals (Object o)
  Tests an arbitrary Object to this DataFlavor for equality.
@Deprecated
public boolean equals (String s)
  Compares only the mimeType against the passed in String and representationClass is not considered in the comparison.
publicfinal Class<Object> getDefaultRepresentationClass ()
publicfinal String getDefaultRepresentationClassAsString ()
public String getHumanPresentableName ()
  Returns the human presentable name for the data format that this DataFlavor represents.
public String getMimeType ()
  Returns the MIME type string for this DataFlavor.
public String getParameter (String paramName)
  Returns the human presentable name for this DataFlavor if paramName equals "humanPresentableName".
public String getPrimaryType ()
  Returns the primary MIME type for this DataFlavor.
public Reader getReaderForText (Transferable transferable) throws UnsupportedFlavorException IOException
  Gets a Reader for a text flavor, decoded, if necessary, for the expected charset (encoding).
public Class<Object> getRepresentationClass ()
  Returns the Class which objects supporting this DataFlavor will return when this DataFlavor is requested.
public String getSubType ()
  Returns the sub MIME type of this DataFlavor.
publicfinalstatic DataFlavor getTextPlainUnicodeFlavor ()
  Returns a DataFlavor representing plain text with Unicode encoding, where:
public int hashCode ()
  Returns hash code for this DataFlavor.
public boolean isFlavorJavaFileListType ()
  Returns true if the DataFlavor specified represents a list of file objects.
public boolean isFlavorRemoteObjectType ()
  Returns true if the DataFlavor specified represents a remote object.
public boolean isFlavorSerializedObjectType ()
  Returns true if the DataFlavor specified represents a serialized object.
public boolean isFlavorTextType ()
  Returns whether this DataFlavor is a valid text flavor for this implementation of the Java platform.
publicfinal boolean isMimeTypeEqual (DataFlavor dataFlavor)
  Compares the mimeType of two DataFlavor objects.
public boolean isMimeTypeEqual (String mimeType)
  Returns whether the string representation of the MIME type passed in is equivalent to the MIME type of this DataFlavor.
public boolean isMimeTypeSerializedObject ()
Does the DataFlavor represent a serialized object?
public boolean isRepresentationClassByteBuffer ()
  Returns whether the representation class for this DataFlavor is java.nio.ByteBuffer or a subclass thereof.
public boolean isRepresentationClassCharBuffer ()
  Returns whether the representation class for this DataFlavor is java.nio.CharBuffer or a subclass thereof.
public boolean isRepresentationClassInputStream ()
Does the DataFlavor represent a java.io.InputStream?
public boolean isRepresentationClassReader ()
  Returns whether the representation class for this DataFlavor is java.io.Reader or a subclass thereof.
public boolean isRepresentationClassRemote ()
  Returns true if the representation class is Remote.
public boolean isRepresentationClassSerializable ()
  Returns true if the representation class can be serialized.
public boolean match (DataFlavor that)
  Tests a DataFlavor to this DataFlavor for equality.
@Deprecated
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.
@Deprecated
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.
publicsynchronized void readExternal (ObjectInput is) throws IOException ClassNotFoundException [Specified in Externalizable]
Restores this DataFlavor from a Serialized state.
publicfinalstatic DataFlavor selectBestTextFlavor (DataFlavor availableFlavors)
  Selects the best text DataFlavor from an array of DataFlavors.
public void setHumanPresentableName (String humanPresentableName)
  Sets the human presentable name for the data format that this DataFlavor represents.
public String toString ()
  String representation of this DataFlavor and its parameters.
protectedfinalstatic Class<Object> tryToLoadClass (String className, ClassLoader fallback) throws ClassNotFoundException
  Tries to load a class from: the bootstrap loader, the system loader, the context loader (if one is present) and finally the loader specified.
publicsynchronized void writeExternal (ObjectOutput os) throws IOException [Specified in Externalizable]
Serializes this DataFlavor.
Fields
Hide/Show inherited fields
pack-privatetransient int atom
publicfinalstatic DataFlavor imageFlavor
  The DataFlavor representing a Java Image class, where:
publicfinalstatic DataFlavor javaFileListFlavor
  To transfer a list of files to/from Java (and the underlying platform) a DataFlavor of this type/subtype and representation class of java.util.List is used.
publicfinalstatic String javaJVMLocalObjectMimeType = "application/x-java-jvm-local-objectref"
  To transfer a reference to an arbitrary Java object reference that has no associated MIME Content-type, across a Transferable interface WITHIN THE SAME JVM, a DataFlavor with this type/subtype is used, with a representationClass equal to the type of the class/interface being passed across the Transferable.
publicfinalstatic String javaRemoteObjectMimeType = "application/x-java-remote-object"
In order to pass a live link to a Remote object via a Drag and Drop ACTION_LINK operation a Mime Content Type of application/x-java-remote-object should be used, where the representation class of the DataFlavor represents the type of the Remote interface to be transferred.
publicfinalstatic String javaSerializedObjectMimeType = "application/x-java-serialized-object"
  A MIME Content-Type of application/x-java-serialized-object represents a graph of Java object(s) that have been made persistent.
pack-private MimeType mimeType
@Deprecated
publicfinalstatic DataFlavor plainTextFlavor
  The DataFlavor representing plain text with Unicode encoding, where:
publicfinalstatic DataFlavor stringFlavor
  The DataFlavor representing a Java Unicode String class, where:
Nested Classes
  DataFlavor.TextFlavorComparator
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar