java.awt.datatransfer
Class DataFlavor

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.datatransfer.DataFlavor
All Implemented Interfaces:
Externalizable sample code for java.io.Externalizable definition code for java.io.Externalizable , Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

public class DataFlavor
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Externalizable sample code for java.io.Externalizable definition code for java.io.Externalizable , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

Each instance represents the opaque concept of a data format as would appear on a clipboard, during drag and drop, or in a file system.

DataFlavor objects are constant and never change once instantiated.

For information on using data transfer with Swing, see How to Use Drag and Drop and Data Transfer, a section in The Java Tutorial, for more information.

See Also:
Serialized Form

Field Summary
static DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor imageFlavor sample code for java.awt.datatransfer.DataFlavor.imageFlavor definition code for java.awt.datatransfer.DataFlavor.imageFlavor
          The DataFlavor representing a Java Image class, where:
static DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor javaFileListFlavor sample code for java.awt.datatransfer.DataFlavor.javaFileListFlavor definition code for java.awt.datatransfer.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.
static String sample code for java.lang.String definition code for java.lang.String javaJVMLocalObjectMimeType sample code for java.awt.datatransfer.DataFlavor.javaJVMLocalObjectMimeType definition code for java.awt.datatransfer.DataFlavor.javaJVMLocalObjectMimeType
          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.
static String sample code for java.lang.String definition code for java.lang.String javaRemoteObjectMimeType sample code for java.awt.datatransfer.DataFlavor.javaRemoteObjectMimeType definition code for java.awt.datatransfer.DataFlavor.javaRemoteObjectMimeType
          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.
static String sample code for java.lang.String definition code for java.lang.String javaSerializedObjectMimeType sample code for java.awt.datatransfer.DataFlavor.javaSerializedObjectMimeType definition code for java.awt.datatransfer.DataFlavor.javaSerializedObjectMimeType
          A MIME Content-Type of application/x-java-serialized-object represents a graph of Java object(s) that have been made persistent.
static DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor plainTextFlavor sample code for java.awt.datatransfer.DataFlavor.plainTextFlavor definition code for java.awt.datatransfer.DataFlavor.plainTextFlavor
          Deprecated. as of 1.3. Use DataFlavor.getReaderForText(Transferable) instead of Transferable.getTransferData(DataFlavor.plainTextFlavor).
static DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor stringFlavor sample code for java.awt.datatransfer.DataFlavor.stringFlavor definition code for java.awt.datatransfer.DataFlavor.stringFlavor
          The DataFlavor representing a Java Unicode String class, where:
 
Constructor Summary
DataFlavor sample code for java.awt.datatransfer.DataFlavor.DataFlavor() definition code for java.awt.datatransfer.DataFlavor.DataFlavor() ()
          Constructs a new DataFlavor.
DataFlavor sample code for java.awt.datatransfer.DataFlavor.DataFlavor(java.lang.Class, java.lang.String) definition code for java.awt.datatransfer.DataFlavor.DataFlavor(java.lang.Class, java.lang.String) (Class sample code for java.lang.Class definition code for java.lang.Class <?> representationClass, String sample code for java.lang.String definition code for java.lang.String  humanPresentableName)
          Constructs a DataFlavor that represents a Java class.
DataFlavor sample code for java.awt.datatransfer.DataFlavor.DataFlavor(java.lang.String) definition code for java.awt.datatransfer.DataFlavor.DataFlavor(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  mimeType)
          Constructs a DataFlavor from a mimeType string.
DataFlavor sample code for java.awt.datatransfer.DataFlavor.DataFlavor(java.lang.String, java.lang.String) definition code for java.awt.datatransfer.DataFlavor.DataFlavor(java.lang.String, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  mimeType, String sample code for java.lang.String definition code for java.lang.String  humanPresentableName)
          Constructs a DataFlavor that represents a MimeType.
DataFlavor sample code for java.awt.datatransfer.DataFlavor.DataFlavor(java.lang.String, java.lang.String, java.lang.ClassLoader) definition code for java.awt.datatransfer.DataFlavor.DataFlavor(java.lang.String, java.lang.String, java.lang.ClassLoader) (String sample code for java.lang.String definition code for java.lang.String  mimeType, String sample code for java.lang.String definition code for java.lang.String  humanPresentableName, ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  classLoader)
          Constructs a DataFlavor that represents a MimeType.
 
Method Summary
 Object sample code for java.lang.Object definition code for java.lang.Object clone sample code for java.awt.datatransfer.DataFlavor.clone() definition code for java.awt.datatransfer.DataFlavor.clone() ()
          Returns a clone of this DataFlavor.
 boolean equals sample code for java.awt.datatransfer.DataFlavor.equals(java.awt.datatransfer.DataFlavor) definition code for java.awt.datatransfer.DataFlavor.equals(java.awt.datatransfer.DataFlavor) (DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor  that)
          Tests a DataFlavor to this DataFlavor for equality.
 boolean equals sample code for java.awt.datatransfer.DataFlavor.equals(java.lang.Object) definition code for java.awt.datatransfer.DataFlavor.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  o)
          Tests an arbitrary Object to this DataFlavor for equality.
 boolean equals sample code for java.awt.datatransfer.DataFlavor.equals(java.lang.String) definition code for java.awt.datatransfer.DataFlavor.equals(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  s)
          Deprecated. As inconsistent with hashCode() contract, use isMimeTypeEqual(String) instead.
 Class sample code for java.lang.Class definition code for java.lang.Class <?> getDefaultRepresentationClass sample code for java.awt.datatransfer.DataFlavor.getDefaultRepresentationClass() definition code for java.awt.datatransfer.DataFlavor.getDefaultRepresentationClass() ()
           
 String sample code for java.lang.String definition code for java.lang.String getDefaultRepresentationClassAsString sample code for java.awt.datatransfer.DataFlavor.getDefaultRepresentationClassAsString() definition code for java.awt.datatransfer.DataFlavor.getDefaultRepresentationClassAsString() ()
           
 String sample code for java.lang.String definition code for java.lang.String getHumanPresentableName sample code for java.awt.datatransfer.DataFlavor.getHumanPresentableName() definition code for java.awt.datatransfer.DataFlavor.getHumanPresentableName() ()
          Returns the human presentable name for the data format that this DataFlavor represents.
 String sample code for java.lang.String definition code for java.lang.String getMimeType sample code for java.awt.datatransfer.DataFlavor.getMimeType() definition code for java.awt.datatransfer.DataFlavor.getMimeType() ()
          Returns the MIME type string for this DataFlavor.
 String sample code for java.lang.String definition code for java.lang.String getParameter sample code for java.awt.datatransfer.DataFlavor.getParameter(java.lang.String) definition code for java.awt.datatransfer.DataFlavor.getParameter(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  paramName)
          Returns the human presentable name for this DataFlavor if paramName equals "humanPresentableName".
 String sample code for java.lang.String definition code for java.lang.String getPrimaryType sample code for java.awt.datatransfer.DataFlavor.getPrimaryType() definition code for java.awt.datatransfer.DataFlavor.getPrimaryType() ()
          Returns the primary MIME type for this DataFlavor.
 Reader sample code for java.io.Reader definition code for java.io.Reader getReaderForText sample code for java.awt.datatransfer.DataFlavor.getReaderForText(java.awt.datatransfer.Transferable) definition code for java.awt.datatransfer.DataFlavor.getReaderForText(java.awt.datatransfer.Transferable) (Transferable sample code for java.awt.datatransfer.Transferable definition code for java.awt.datatransfer.Transferable  transferable)
          Gets a Reader for a text flavor, decoded, if necessary, for the expected charset (encoding).
 Class sample code for java.lang.Class definition code for java.lang.Class <?> getRepresentationClass sample code for java.awt.datatransfer.DataFlavor.getRepresentationClass() definition code for java.awt.datatransfer.DataFlavor.getRepresentationClass() ()
          Returns the Class which objects supporting this DataFlavor will return when this DataFlavor is requested.
 String sample code for java.lang.String definition code for java.lang.String getSubType sample code for java.awt.datatransfer.DataFlavor.getSubType() definition code for java.awt.datatransfer.DataFlavor.getSubType() ()
          Returns the sub MIME type of this DataFlavor.
static DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor getTextPlainUnicodeFlavor sample code for java.awt.datatransfer.DataFlavor.getTextPlainUnicodeFlavor() definition code for java.awt.datatransfer.DataFlavor.getTextPlainUnicodeFlavor() ()
          Returns a DataFlavor representing plain text with Unicode encoding, where:
 int hashCode sample code for java.awt.datatransfer.DataFlavor.hashCode() definition code for java.awt.datatransfer.DataFlavor.hashCode() ()
          Returns hash code for this DataFlavor.
 boolean isFlavorJavaFileListType sample code for java.awt.datatransfer.DataFlavor.isFlavorJavaFileListType() definition code for java.awt.datatransfer.DataFlavor.isFlavorJavaFileListType() ()
          Returns true if the DataFlavor specified represents a list of file objects.
 boolean isFlavorRemoteObjectType sample code for java.awt.datatransfer.DataFlavor.isFlavorRemoteObjectType() definition code for java.awt.datatransfer.DataFlavor.isFlavorRemoteObjectType() ()
          Returns true if the DataFlavor specified represents a remote object.
 boolean isFlavorSerializedObjectType sample code for java.awt.datatransfer.DataFlavor.isFlavorSerializedObjectType() definition code for java.awt.datatransfer.DataFlavor.isFlavorSerializedObjectType() ()
          Returns true if the DataFlavor specified represents a serialized object.
 boolean isFlavorTextType sample code for java.awt.datatransfer.DataFlavor.isFlavorTextType() definition code for java.awt.datatransfer.DataFlavor.isFlavorTextType() ()
          Returns whether this DataFlavor is a valid text flavor for this implementation of the Java platform.
 boolean isMimeTypeEqual sample code for java.awt.datatransfer.DataFlavor.isMimeTypeEqual(java.awt.datatransfer.DataFlavor) definition code for java.awt.datatransfer.DataFlavor.isMimeTypeEqual(java.awt.datatransfer.DataFlavor) (DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor  dataFlavor)
          Compares the mimeType of two DataFlavor objects.
 boolean isMimeTypeEqual sample code for java.awt.datatransfer.DataFlavor.isMimeTypeEqual(java.lang.String) definition code for java.awt.datatransfer.DataFlavor.isMimeTypeEqual(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  mimeType)
          Returns whether the string representation of the MIME type passed in is equivalent to the MIME type of this DataFlavor.
 boolean isMimeTypeSerializedObject sample code for java.awt.datatransfer.DataFlavor.isMimeTypeSerializedObject() definition code for java.awt.datatransfer.DataFlavor.isMimeTypeSerializedObject() ()
          Does the DataFlavor represent a serialized object?
 boolean isRepresentationClassByteBuffer sample code for java.awt.datatransfer.DataFlavor.isRepresentationClassByteBuffer() definition code for java.awt.datatransfer.DataFlavor.isRepresentationClassByteBuffer() ()
          Returns whether the representation class for this DataFlavor is java.nio.ByteBuffer or a subclass thereof.
 boolean isRepresentationClassCharBuffer sample code for java.awt.datatransfer.DataFlavor.isRepresentationClassCharBuffer() definition code for java.awt.datatransfer.DataFlavor.isRepresentationClassCharBuffer() ()
          Returns whether the representation class for this DataFlavor is java.nio.CharBuffer or a subclass thereof.
 boolean isRepresentationClassInputStream sample code for java.awt.datatransfer.DataFlavor.isRepresentationClassInputStream() definition code for java.awt.datatransfer.DataFlavor.isRepresentationClassInputStream() ()
          Does the DataFlavor represent a java.io.InputStream?
 boolean isRepresentationClassReader sample code for java.awt.datatransfer.DataFlavor.isRepresentationClassReader() definition code for java.awt.datatransfer.DataFlavor.isRepresentationClassReader() ()
          Returns whether the representation class for this DataFlavor is java.io.Reader or a subclass thereof.
 boolean isRepresentationClassRemote sample code for java.awt.datatransfer.DataFlavor.isRepresentationClassRemote() definition code for java.awt.datatransfer.DataFlavor.isRepresentationClassRemote() ()
          Returns true if the representation class is Remote.
 boolean isRepresentationClassSerializable sample code for java.awt.datatransfer.DataFlavor.isRepresentationClassSerializable() definition code for java.awt.datatransfer.DataFlavor.isRepresentationClassSerializable() ()
          Returns true if the representation class can be serialized.
 boolean match sample code for java.awt.datatransfer.DataFlavor.match(java.awt.datatransfer.DataFlavor) definition code for java.awt.datatransfer.DataFlavor.match(java.awt.datatransfer.DataFlavor) (DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor  that)
          Tests a DataFlavor to this DataFlavor for equality.
protected  String sample code for java.lang.String definition code for java.lang.String normalizeMimeType sample code for java.awt.datatransfer.DataFlavor.normalizeMimeType(java.lang.String) definition code for java.awt.datatransfer.DataFlavor.normalizeMimeType(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  mimeType)
          Deprecated.  
protected  String sample code for java.lang.String definition code for java.lang.String normalizeMimeTypeParameter sample code for java.awt.datatransfer.DataFlavor.normalizeMimeTypeParameter(java.lang.String, java.lang.String) definition code for java.awt.datatransfer.DataFlavor.normalizeMimeTypeParameter(java.lang.String, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName, String sample code for java.lang.String definition code for java.lang.String  parameterValue)
          Deprecated.  
 void readExternal sample code for java.awt.datatransfer.DataFlavor.readExternal(java.io.ObjectInput) definition code for java.awt.datatransfer.DataFlavor.readExternal(java.io.ObjectInput) (ObjectInput sample code for java.io.ObjectInput definition code for java.io.ObjectInput  is)
          Restores this DataFlavor from a Serialized state.
static DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor selectBestTextFlavor sample code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) definition code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) (DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor [] availableFlavors)
          Selects the best text DataFlavor from an array of DataFlavors.
 void setHumanPresentableName sample code for java.awt.datatransfer.DataFlavor.setHumanPresentableName(java.lang.String) definition code for java.awt.datatransfer.DataFlavor.setHumanPresentableName(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  humanPresentableName)
          Sets the human presentable name for the data format that this DataFlavor represents.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for java.awt.datatransfer.DataFlavor.toString() definition code for java.awt.datatransfer.DataFlavor.toString() ()
          String representation of this DataFlavor and its parameters.
protected static Class sample code for java.lang.Class definition code for java.lang.Class <?> tryToLoadClass sample code for java.awt.datatransfer.DataFlavor.tryToLoadClass(java.lang.String, java.lang.ClassLoader) definition code for java.awt.datatransfer.DataFlavor.tryToLoadClass(java.lang.String, java.lang.ClassLoader) (String sample code for java.lang.String definition code for java.lang.String  className, ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  fallback)
          Tries to load a class from: the bootstrap loader, the system loader, the context loader (if one is present) and finally the loader specified.
 void writeExternal sample code for java.awt.datatransfer.DataFlavor.writeExternal(java.io.ObjectOutput) definition code for java.awt.datatransfer.DataFlavor.writeExternal(java.io.ObjectOutput) (ObjectOutput sample code for java.io.ObjectOutput definition code for java.io.ObjectOutput  os)
          Serializes this DataFlavor.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

stringFlavor sample code for java.awt.datatransfer.DataFlavor.stringFlavor

public static final DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor  stringFlavor
The DataFlavor representing a Java Unicode String class, where:
     representationClass = java.lang.String
     mimeType           = "application/x-java-serialized-object"        
 


imageFlavor sample code for java.awt.datatransfer.DataFlavor.imageFlavor

public static final DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor  imageFlavor
The DataFlavor representing a Java Image class, where:
     representationClass = java.awt.Image
     mimeType            = "image/x-java-image"
 


plainTextFlavor sample code for java.awt.datatransfer.DataFlavor.plainTextFlavor

@Deprecated
public static final DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor  plainTextFlavor
Deprecated. as of 1.3. Use DataFlavor.getReaderForText(Transferable) instead of Transferable.getTransferData(DataFlavor.plainTextFlavor).
The DataFlavor representing plain text with Unicode encoding, where:
     representationClass = InputStream
     mimeType            = "text/plain; charset=unicode"
 
This DataFlavor has been deprecated because (1) Its representation is an InputStream, an 8-bit based representation, while Unicode is a 16-bit character set; and (2) The charset "unicode" is not well-defined. "unicode" implies a particular platform's implementation of Unicode, not a cross-platform implementation.


javaSerializedObjectMimeType sample code for java.awt.datatransfer.DataFlavor.javaSerializedObjectMimeType

public static final String sample code for java.lang.String definition code for java.lang.String  javaSerializedObjectMimeType
A MIME Content-Type of application/x-java-serialized-object represents a graph of Java object(s) that have been made persistent. The representation class associated with this DataFlavor identifies the Java type of an object returned as a reference from an invocation java.awt.datatransfer.getTransferData.

See Also:
Constant Field Values

javaFileListFlavor sample code for java.awt.datatransfer.DataFlavor.javaFileListFlavor

public static final DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.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. Each element of the list is required/guaranteed to be of type java.io.File.


javaJVMLocalObjectMimeType sample code for java.awt.datatransfer.DataFlavor.javaJVMLocalObjectMimeType

public static final String sample code for java.lang.String definition code for java.lang.String  javaJVMLocalObjectMimeType
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.

The object reference returned from Transferable.getTransferData for a DataFlavor with this MIME Content-Type is required to be an instance of the representation Class of the DataFlavor.

See Also:
Constant Field Values

javaRemoteObjectMimeType sample code for java.awt.datatransfer.DataFlavor.javaRemoteObjectMimeType

public static final String sample code for java.lang.String definition code for java.lang.String  javaRemoteObjectMimeType
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.

See Also:
Constant Field Values
Constructor Detail

DataFlavor sample code for java.awt.datatransfer.DataFlavor() definition code for java.awt.datatransfer.DataFlavor()

public DataFlavor()
Constructs a new DataFlavor. This constructor is provided only for the purpose of supporting the Externalizable interface. It is not intended for public (client) use.

Since:
1.2

DataFlavor sample code for java.awt.datatransfer.DataFlavor(java.lang.Class<?>, java.lang.String) definition code for java.awt.datatransfer.DataFlavor(java.lang.Class<?>, java.lang.String)

public DataFlavor(Class sample code for java.lang.Class definition code for java.lang.Class <?> representationClass,
                  String sample code for java.lang.String definition code for java.lang.String  humanPresentableName)
Constructs a DataFlavor that represents a Java class.

The returned DataFlavor will have the following characteristics:

    representationClass = representationClass
    mimeType            = application/x-java-serialized-object        
 

Parameters:
representationClass - the class used to transfer data in this flavor
humanPresentableName - the human-readable string used to identify this flavor; if this parameter is null then the value of the the MIME Content Type is used
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if representationClass is null

DataFlavor sample code for java.awt.datatransfer.DataFlavor(java.lang.String, java.lang.String) definition code for java.awt.datatransfer.DataFlavor(java.lang.String, java.lang.String)

public DataFlavor(String sample code for java.lang.String definition code for java.lang.String  mimeType,
                  String sample code for java.lang.String definition code for java.lang.String  humanPresentableName)
Constructs a DataFlavor that represents a MimeType.

The returned DataFlavor will have the following characteristics:

If the mimeType is "application/x-java-serialized-object; class=<representation class>", the result is the same as calling new DataFlavor(Class:forName(<representation class>).

Otherwise:

     representationClass = InputStream
     mimeType            = mimeType         
 

Parameters:
mimeType - the string used to identify the MIME type for this flavor; if the the mimeType does not specify a "class=" parameter, or if the class is not successfully loaded, then an IllegalArgumentException is thrown
humanPresentableName - the human-readable string used to identify this flavor; if this parameter is null then the value of the the MIME Content Type is used
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if mimeType is invalid or if the class is not successfully loaded
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if mimeType is null

DataFlavor sample code for java.awt.datatransfer.DataFlavor(java.lang.String, java.lang.String, java.lang.ClassLoader) definition code for java.awt.datatransfer.DataFlavor(java.lang.String, java.lang.String, java.lang.ClassLoader)

public DataFlavor(String sample code for java.lang.String definition code for java.lang.String  mimeType,
                  String sample code for java.lang.String definition code for java.lang.String  humanPresentableName,
                  ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  classLoader)
           throws ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException 
Constructs a DataFlavor that represents a MimeType.

The returned DataFlavor will have the following characteristics:

If the mimeType is "application/x-java-serialized-object; class=<representation class>", the result is the same as calling new DataFlavor(Class:forName(<representation class>).

Otherwise:

     representationClass = InputStream
     mimeType            = mimeType         
 

Parameters:
mimeType - the string used to identify the MIME type for this flavor
humanPresentableName - the human-readable string used to identify this flavor
classLoader - the class loader to use
Throws:
ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException - if the class is not loaded
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if mimeType is invalid
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if mimeType is null

DataFlavor sample code for java.awt.datatransfer.DataFlavor(java.lang.String) definition code for java.awt.datatransfer.DataFlavor(java.lang.String)

public DataFlavor(String sample code for java.lang.String definition code for java.lang.String  mimeType)
           throws ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException 
Constructs a DataFlavor from a mimeType string. The string can specify a "class=" parameter to create a DataFlavor with the desired representation class. If the string does not contain "class=" parameter, java.io.InputStream is used as default.

Parameters:
mimeType - the string used to identify the MIME type for this flavor; if the class specified by "class=" parameter is not successfully loaded, then an ClassNotFoundException is thrown
Throws:
ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException - if the class is not loaded
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if mimeType is invalid
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if mimeType is null
Method Detail

tryToLoadClass sample code for java.awt.datatransfer.DataFlavor.tryToLoadClass(java.lang.String, java.lang.ClassLoader) definition code for java.awt.datatransfer.DataFlavor.tryToLoadClass(java.lang.String, java.lang.ClassLoader)

protected static final Class sample code for java.lang.Class definition code for java.lang.Class <?> tryToLoadClass(String sample code for java.lang.String definition code for java.lang.String  className,
                                               ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  fallback)
                                        throws ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.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.

Parameters:
className - the name of the class to be loaded
fallback - the fallback loader
Returns:
the class loaded
Throws:
ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException - if class is not found

toString sample code for java.awt.datatransfer.DataFlavor.toString() definition code for java.awt.datatransfer.DataFlavor.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
String representation of this DataFlavor and its parameters. The resulting String contains the name of the DataFlavor class, this flavor's MIME type, and its representation class. If this flavor has a primary MIME type of "text", supports the charset parameter, and has an encoded representation, the flavor's charset is also included. See selectBestTextFlavor for a list of text flavors which support the charset parameter.

Overrides:
toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
string representation of this DataFlavor
See Also:
selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) sample code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) definition code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[])

getTextPlainUnicodeFlavor sample code for java.awt.datatransfer.DataFlavor.getTextPlainUnicodeFlavor() definition code for java.awt.datatransfer.DataFlavor.getTextPlainUnicodeFlavor()

public static final DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor  getTextPlainUnicodeFlavor()
Returns a DataFlavor representing plain text with Unicode encoding, where:
     representationClass = java.io.InputStream
     mimeType            = "text/plain;
                            charset=<platform default Unicode encoding>"
 
Sun's implementation for Microsoft Windows uses the encoding utf-16le. Sun's implementation for Solaris and Linux uses the encoding iso-10646-ucs-2.

Returns:
a DataFlavor representing plain text with Unicode encoding

selectBestTextFlavor sample code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) definition code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[])

public static final DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor  selectBestTextFlavor(DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor [] availableFlavors)
Selects the best text DataFlavor from an array of DataFlavors. Only DataFlavor.stringFlavor, and equivalent flavors, and flavors that have a primary MIME type of "text", are considered for selection.

Flavors are first sorted by their MIME types in the following order:

For example, "text/sgml" will be selected over "text/html", and DataFlavor.stringFlavor will be chosen over DataFlavor.plainTextFlavor.

If two or more flavors share the best MIME type in the array, then that MIME type will be checked to see if it supports the charset parameter.

The following MIME types support, or are treated as though they support, the charset parameter:

The following MIME types do not support, or are treated as though they do not support, the charset parameter: For "text/<other>" MIME types, the first time the JRE needs to determine whether the MIME type supports the charset parameter, it will check whether the parameter is explicitly listed in an arbitrarily chosen DataFlavor which uses that MIME type. If so, the JRE will assume from that point on that the MIME type supports the charset parameter and will not check again. If the parameter is not explicitly listed, the JRE will assume from that point on that the MIME type does not support the charset parameter and will not check again. Because this check is performed on an arbitrarily chosen DataFlavor, developers must ensure that all DataFlavors with a "text/<other>" MIME type specify the charset parameter if it is supported by that MIME type. Developers should never rely on the JRE to substitute the platform's default charset for a "text/<other>" DataFlavor. Failure to adhere to this restriction will lead to undefined behavior.

If the best MIME type in the array does not support the charset parameter, the flavors which share that MIME type will then be sorted by their representation classes in the following order: java.io.InputStream, java.nio.ByteBuffer, [B, <all others>.

If two or more flavors share the best representation class, or if no flavor has one of the three specified representations, then one of those flavors will be chosen non-deterministically.

If the best MIME type in the array does support the charset parameter, the flavors which share that MIME type will then be sorted by their representation classes in the following order: java.io.Reader, java.lang.String, java.nio.CharBuffer, [C, <all others>.

If two or more flavors share the best representation class, and that representation is one of the four explicitly listed, then one of those flavors will be chosen non-deterministically. If, however, no flavor has one of the four specified representations, the flavors will then be sorted by their charsets. Unicode charsets, such as "UTF-16", "UTF-8", "UTF-16BE", "UTF-16LE", and their aliases, are considered best. After them, the platform default charset and its aliases are selected. "US-ASCII" and its aliases are worst. All other charsets are chosen in alphabetical order, but only charsets supported by this implementation of the Java platform will be considered.

If two or more flavors share the best charset, the flavors will then again be sorted by their representation classes in the following order: java.io.InputStream, java.nio.ByteBuffer, [B, <all others>.

If two or more flavors share the best representation class, or if no flavor has one of the three specified representations, then one of those flavors will be chosen non-deterministically.

Parameters:
availableFlavors - an array of available DataFlavors
Returns:
the best (highest fidelity) flavor according to the rules specified above, or null, if availableFlavors is null, has zero length, or contains no text flavors
Since:
1.3

getReaderForText sample code for java.awt.datatransfer.DataFlavor.getReaderForText(java.awt.datatransfer.Transferable) definition code for java.awt.datatransfer.DataFlavor.getReaderForText(java.awt.datatransfer.Transferable)

public Reader sample code for java.io.Reader definition code for java.io.Reader  getReaderForText(Transferable sample code for java.awt.datatransfer.Transferable definition code for java.awt.datatransfer.Transferable  transferable)
                        throws UnsupportedFlavorException sample code for java.awt.datatransfer.UnsupportedFlavorException definition code for java.awt.datatransfer.UnsupportedFlavorException ,
                               IOException sample code for java.io.IOException definition code for java.io.IOException 
Gets a Reader for a text flavor, decoded, if necessary, for the expected charset (encoding). The supported representation classes are java.io.Reader, java.lang.String, java.nio.CharBuffer, [C, java.io.InputStream, java.nio.ByteBuffer, and [B.

Because text flavors which do not support the charset parameter are encoded in a non-standard format, this method should not be called for such flavors. However, in order to maintain backward-compatibility, if this method is called for such a flavor, this method will treat the flavor as though it supports the charset parameter and attempt to decode it accordingly. See selectBestTextFlavor for a list of text flavors which do not support the charset parameter.

Parameters:
transferable - the Transferable whose data will be requested in this flavor
Returns:
a Reader to read the Transferable's data
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the representation class is not one of the seven listed above
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the Transferable has null data
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if the Transferable is null
UnsupportedEncodingException sample code for java.io.UnsupportedEncodingException definition code for java.io.UnsupportedEncodingException - if this flavor's representation is java.io.InputStream, java.nio.ByteBuffer, or [B and this flavor's encoding is not supported by this implementation of the Java platform
UnsupportedFlavorException sample code for java.awt.datatransfer.UnsupportedFlavorException definition code for java.awt.datatransfer.UnsupportedFlavorException - if the Transferable does not support this flavor
IOException sample code for java.io.IOException definition code for java.io.IOException - if the data cannot be read because of an I/O error
Since:
1.3
See Also:
selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) sample code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) definition code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[])

getMimeType sample code for java.awt.datatransfer.DataFlavor.getMimeType() definition code for java.awt.datatransfer.DataFlavor.getMimeType()

public String sample code for java.lang.String definition code for java.lang.String  getMimeType()
Returns the MIME type string for this DataFlavor.

Returns:
the MIME type string for this flavor

getRepresentationClass sample code for java.awt.datatransfer.DataFlavor.getRepresentationClass() definition code for java.awt.datatransfer.DataFlavor.getRepresentationClass()

public Class sample code for java.lang.Class definition code for java.lang.Class <?> getRepresentationClass()
Returns the Class which objects supporting this DataFlavor will return when this DataFlavor is requested.

Returns:
the Class which objects supporting this DataFlavor will return when this DataFlavor is requested

getHumanPresentableName sample code for java.awt.datatransfer.DataFlavor.getHumanPresentableName() definition code for java.awt.datatransfer.DataFlavor.getHumanPresentableName()

public String sample code for java.lang.String definition code for java.lang.String  getHumanPresentableName()
Returns the human presentable name for the data format that this DataFlavor represents. This name would be localized for different countries.

Returns:
the human presentable name for the data format that this DataFlavor represents

getPrimaryType sample code for java.awt.datatransfer.DataFlavor.getPrimaryType() definition code for java.awt.datatransfer.DataFlavor.getPrimaryType()

public String sample code for java.lang.String definition code for java.lang.String  getPrimaryType()
Returns the primary MIME type for this DataFlavor.

Returns:
the primary MIME type of this DataFlavor

getSubType sample code for java.awt.datatransfer.DataFlavor.getSubType() definition code for java.awt.datatransfer.DataFlavor.getSubType()

public String sample code for java.lang.String definition code for java.lang.String  getSubType()
Returns the sub MIME type of this DataFlavor.

Returns:
the Sub MIME type of this DataFlavor

getParameter sample code for java.awt.datatransfer.DataFlavor.getParameter(java.lang.String) definition code for java.awt.datatransfer.DataFlavor.getParameter(java.lang.String)

public String sample code for java.lang.String definition code for java.lang.String  getParameter(String sample code for java.lang.String definition code for java.lang.String  paramName)
Returns the human presentable name for this DataFlavor if paramName equals "humanPresentableName". Otherwise returns the MIME type value associated with paramName.

Parameters:
paramName - the parameter name requested
Returns:
the value of the name parameter, or null if there is no associated value

setHumanPresentableName sample code for java.awt.datatransfer.DataFlavor.setHumanPresentableName(java.lang.String) definition code for java.awt.datatransfer.DataFlavor.setHumanPresentableName(java.lang.String)

public void setHumanPresentableName(String sample code for java.lang.String definition code for java.lang.String  humanPresentableName)
Sets the human presentable name for the data format that this DataFlavor represents. This name would be localized for different countries.

Parameters:
humanPresentableName - the new human presentable name

equals sample code for java.awt.datatransfer.DataFlavor.equals(java.lang.Object) definition code for java.awt.datatransfer.DataFlavor.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  o)
Tests an arbitrary Object to this DataFlavor for equality. Two DataFlavors are considered equal if and only if their MIME primary type and subtype and representation class are equal. Additionally, if the primary type is "text", the subtype denotes a text flavor which supports the charset parameter, and the representation class is not java.io.Reader, java.lang.String, java.nio.CharBuffer, or [C, the charset parameter must also be equal. If a charset is not explicitly specified for one or both DataFlavors, the platform default encoding is assumed. See selectBestTextFlavor for a list of text flavors which support the charset parameter.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
o - the Object to compare with this
Returns:
true if that is equivalent to this DataFlavor; false otherwise
See Also:
selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) sample code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) definition code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[])

equals sample code for java.awt.datatransfer.DataFlavor.equals(java.awt.datatransfer.DataFlavor) definition code for java.awt.datatransfer.DataFlavor.equals(java.awt.datatransfer.DataFlavor)

public boolean equals(DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor  that)
Tests a DataFlavor to this DataFlavor for equality. Two DataFlavors are considered equal if and only if their MIME primary type and subtype and representation class are equal. Additionally, if the primary type is "text", the subtype denotes a text flavor which supports the charset parameter, and the representation class is not java.io.Reader, java.lang.String, java.nio.CharBuffer, or [C, the charset parameter must also be equal. If a charset is not explicitly specified for one or both DataFlavors, the platform default encoding is assumed. See selectBestTextFlavor for a list of text flavors which support the charset parameter.

Parameters:
that - the DataFlavor to compare with this
Returns:
true if that is equivalent to this DataFlavor; false otherwise
See Also:
selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) sample code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) definition code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[])

equals sample code for java.awt.datatransfer.DataFlavor.equals(java.lang.String) definition code for java.awt.datatransfer.DataFlavor.equals(java.lang.String)

@Deprecated
public boolean equals(String sample code for java.lang.String definition code for java.lang.String  s)
Deprecated. As inconsistent with hashCode() contract, use isMimeTypeEqual(String) instead.

Compares only the mimeType against the passed in String and representationClass is not considered in the comparison. If representationClass needs to be compared, then equals(new DataFlavor(s)) may be used.

Returns:
true if the String (MimeType) is equal

hashCode sample code for java.awt.datatransfer.DataFlavor.hashCode() definition code for java.awt.datatransfer.DataFlavor.hashCode()

public int hashCode()
Returns hash code for this DataFlavor. For two equal DataFlavors, hash codes are equal. For the String that matches DataFlavor.equals(String), it is not guaranteed that DataFlavor's hash code is equal to the hash code of the String.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code for this DataFlavor
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

match sample code for java.awt.datatransfer.DataFlavor.match(java.awt.datatransfer.DataFlavor) definition code for java.awt.datatransfer.DataFlavor.match(java.awt.datatransfer.DataFlavor)

public boolean match(DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor  that)
Tests a DataFlavor to this DataFlavor for equality. Two DataFlavors are considered equal if and only if their MIME primary type and subtype and representation class are equal. Additionally, if the primary type is "text", the subtype denotes a text flavor which supports the charset parameter, and the representation class is not java.io.Reader, java.lang.String, java.nio.CharBuffer, or [C, the charset parameter must also be equal. If a charset is not explicitly specified for one or both DataFlavors, the platform default encoding is assumed. See selectBestTextFlavor for a list of text flavors which support the charset parameter.

Parameters:
that - the DataFlavor to compare with this
Returns:
true if that is equivalent to this DataFlavor; false otherwise
See Also:
selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) sample code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) definition code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[])

isMimeTypeEqual sample code for java.awt.datatransfer.DataFlavor.isMimeTypeEqual(java.lang.String) definition code for java.awt.datatransfer.DataFlavor.isMimeTypeEqual(java.lang.String)

public boolean isMimeTypeEqual(String sample code for java.lang.String definition code for java.lang.String  mimeType)
Returns whether the string representation of the MIME type passed in is equivalent to the MIME type of this DataFlavor. Parameters are not included in the comparison.

Parameters:
mimeType - the string representation of the MIME type
Returns:
true if the string representation of the MIME type passed in is equivalent to the MIME type of this DataFlavor; false otherwise
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if mimeType is null

isMimeTypeEqual sample code for java.awt.datatransfer.DataFlavor.isMimeTypeEqual(java.awt.datatransfer.DataFlavor) definition code for java.awt.datatransfer.DataFlavor.isMimeTypeEqual(java.awt.datatransfer.DataFlavor)

public final boolean isMimeTypeEqual(DataFlavor sample code for java.awt.datatransfer.DataFlavor definition code for java.awt.datatransfer.DataFlavor  dataFlavor)
Compares the mimeType of two DataFlavor objects. No parameters are considered.

Parameters:
dataFlavor - the DataFlavor to be compared
Returns:
true if the MimeTypes are equal, otherwise false

isMimeTypeSerializedObject sample code for java.awt.datatransfer.DataFlavor.isMimeTypeSerializedObject() definition code for java.awt.datatransfer.DataFlavor.isMimeTypeSerializedObject()

public boolean isMimeTypeSerializedObject()
Does the DataFlavor represent a serialized object?


getDefaultRepresentationClass sample code for java.awt.datatransfer.DataFlavor.getDefaultRepresentationClass() definition code for java.awt.datatransfer.DataFlavor.getDefaultRepresentationClass()

public final Class sample code for java.lang.Class definition code for java.lang.Class <?> getDefaultRepresentationClass()

getDefaultRepresentationClassAsString sample code for java.awt.datatransfer.DataFlavor.getDefaultRepresentationClassAsString() definition code for java.awt.datatransfer.DataFlavor.getDefaultRepresentationClassAsString()

public final String sample code for java.lang.String definition code for java.lang.String  getDefaultRepresentationClassAsString()

isRepresentationClassInputStream sample code for java.awt.datatransfer.DataFlavor.isRepresentationClassInputStream() definition code for java.awt.datatransfer.DataFlavor.isRepresentationClassInputStream()

public boolean isRepresentationClassInputStream()
Does the DataFlavor represent a java.io.InputStream?


isRepresentationClassReader sample code for java.awt.datatransfer.DataFlavor.isRepresentationClassReader() definition code for java.awt.datatransfer.DataFlavor.isRepresentationClassReader()

public boolean isRepresentationClassReader()
Returns whether the representation class for this DataFlavor is java.io.Reader or a subclass thereof.

Since:
1.4

isRepresentationClassCharBuffer sample code for java.awt.datatransfer.DataFlavor.isRepresentationClassCharBuffer() definition code for java.awt.datatransfer.DataFlavor.isRepresentationClassCharBuffer()

public boolean isRepresentationClassCharBuffer()
Returns whether the representation class for this DataFlavor is java.nio.CharBuffer or a subclass thereof.

Since:
1.4

isRepresentationClassByteBuffer sample code for java.awt.datatransfer.DataFlavor.isRepresentationClassByteBuffer() definition code for java.awt.datatransfer.DataFlavor.isRepresentationClassByteBuffer()

public boolean isRepresentationClassByteBuffer()
Returns whether the representation class for this DataFlavor is java.nio.ByteBuffer or a subclass thereof.

Since:
1.4

isRepresentationClassSerializable sample code for java.awt.datatransfer.DataFlavor.isRepresentationClassSerializable() definition code for java.awt.datatransfer.DataFlavor.isRepresentationClassSerializable()

public boolean isRepresentationClassSerializable()
Returns true if the representation class can be serialized.

Returns:
true if the representation class can be serialized

isRepresentationClassRemote sample code for java.awt.datatransfer.DataFlavor.isRepresentationClassRemote() definition code for java.awt.datatransfer.DataFlavor.isRepresentationClassRemote()

public boolean isRepresentationClassRemote()
Returns true if the representation class is Remote.

Returns:
true if the representation class is Remote

isFlavorSerializedObjectType sample code for java.awt.datatransfer.DataFlavor.isFlavorSerializedObjectType() definition code for java.awt.datatransfer.DataFlavor.isFlavorSerializedObjectType()

public boolean isFlavorSerializedObjectType()
Returns true if the DataFlavor specified represents a serialized object.

Returns:
true if the DataFlavor specified represents a Serialized Object

isFlavorRemoteObjectType sample code for java.awt.datatransfer.DataFlavor.isFlavorRemoteObjectType() definition code for java.awt.datatransfer.DataFlavor.isFlavorRemoteObjectType()

public boolean isFlavorRemoteObjectType()
Returns true if the DataFlavor specified represents a remote object.

Returns:
true if the DataFlavor specified represents a Remote Object

isFlavorJavaFileListType sample code for java.awt.datatransfer.DataFlavor.isFlavorJavaFileListType() definition code for java.awt.datatransfer.DataFlavor.isFlavorJavaFileListType()

public boolean isFlavorJavaFileListType()
Returns true if the DataFlavor specified represents a list of file objects.

Returns:
true if the DataFlavor specified represents a List of File objects

isFlavorTextType sample code for java.awt.datatransfer.DataFlavor.isFlavorTextType() definition code for java.awt.datatransfer.DataFlavor.isFlavorTextType()

public boolean isFlavorTextType()
Returns whether this DataFlavor is a valid text flavor for this implementation of the Java platform. Only flavors equivalent to DataFlavor.stringFlavor and DataFlavors with a primary MIME type of "text" can be valid text flavors.

If this flavor supports the charset parameter, it must be equivalent to DataFlavor.stringFlavor, or its representation must be java.io.Reader, java.lang.String, java.nio.CharBuffer, [C, java.io.InputStream, java.nio.ByteBuffer, or [B. If the representation is java.io.InputStream, java.nio.ByteBuffer, or [B, then this flavor's charset parameter must be supported by this implementation of the Java platform. If a charset is not specified, then the platform default charset, which is always supported, is assumed.

If this flavor does not support the charset parameter, its representation must be java.io.InputStream, java.nio.ByteBuffer, or [B.

See selectBestTextFlavor for a list of text flavors which support the charset parameter.

Returns:
true if this DataFlavor is a valid text flavor as described above; false otherwise
Since:
1.4
See Also:
selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) sample code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[]) definition code for java.awt.datatransfer.DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[])

writeExternal sample code for java.awt.datatransfer.DataFlavor.writeExternal(java.io.ObjectOutput) definition code for java.awt.datatransfer.DataFlavor.writeExternal(java.io.ObjectOutput)

public void writeExternal(ObjectOutput sample code for java.io.ObjectOutput definition code for java.io.ObjectOutput  os)
                   throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Serializes this DataFlavor.

Specified by:
writeExternal sample code for java.io.Externalizable.writeExternal(java.io.ObjectOutput) definition code for java.io.Externalizable.writeExternal(java.io.ObjectOutput) in interface Externalizable sample code for java.io.Externalizable definition code for java.io.Externalizable
Parameters:
os - the stream to write the object to
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - Includes any I/O exceptions that may occur

readExternal sample code for java.awt.datatransfer.DataFlavor.readExternal(java.io.ObjectInput) definition code for java.awt.datatransfer.DataFlavor.readExternal(java.io.ObjectInput)

public void readExternal(ObjectInput sample code for java.io.ObjectInput definition code for java.io.ObjectInput  is)
                  throws IOException sample code for java.io.IOException definition code for java.io.IOException ,
                         ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException 
Restores this DataFlavor from a Serialized state.

Specified by:
readExternal sample code for java.io.Externalizable.readExternal(java.io.ObjectInput) definition code for java.io.Externalizable.readExternal(java.io.ObjectInput) in interface Externalizable sample code for java.io.Externalizable definition code for java.io.Externalizable
Parameters:
is - the stream to read data from in order to restore the object
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if I/O errors occur
ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException - If the class for an object being restored cannot be found.

clone sample code for java.awt.datatransfer.DataFlavor.clone() definition code for java.awt.datatransfer.DataFlavor.clone()

public Object sample code for java.lang.Object definition code for java.lang.Object  clone()
             throws CloneNotSupportedException sample code for java.lang.CloneNotSupportedException definition code for java.lang.CloneNotSupportedException 
Returns a clone of this DataFlavor.

Overrides:
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a clone of this DataFlavor
Throws:
CloneNotSupportedException sample code for java.lang.CloneNotSupportedException definition code for java.lang.CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
See Also:
Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

normalizeMimeTypeParameter sample code for java.awt.datatransfer.DataFlavor.normalizeMimeTypeParameter(java.lang.String, java.lang.String) definition code for java.awt.datatransfer.DataFlavor.normalizeMimeTypeParameter(java.lang.String, java.lang.String)

@Deprecated
protected String sample code for java.lang.String definition code for java.lang.String  normalizeMimeTypeParameter(String sample code for java.lang.String definition code for java.lang.String  parameterName,
                                                       String sample code for java.lang.String definition code for java.lang.String  parameterValue)
Deprecated. 

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 from 1.1 onwards.


normalizeMimeType sample code for java.awt.datatransfer.DataFlavor.normalizeMimeType(java.lang.String) definition code for java.awt.datatransfer.DataFlavor.normalizeMimeType(java.lang.String)

@Deprecated
protected String sample code for java.lang.String definition code for java.lang.String  normalizeMimeType(String sample code for java.lang.String definition code for java.lang.String  mimeType)
Deprecated. 

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 from 1.1 onwards.