Package docking.dnd

# Class GenericDataFlavor

java.lang.Object
java.awt.datatransfer.DataFlavor
docking.dnd.GenericDataFlavor

All Implemented Interfaces:
  `Externalizable`, `Serializable`, `Cloneable`

public class GenericDataFlavor extends DataFlavor
Generic data flavor class to override the equals(DataFlavor) method in order to have data flavors support the same general class types such as an ArrayList.

See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class java.awt.datatransfer.DataFlavor

  `allHtmlFlavor, fragmentHtmlFlavor, imageFlavor, javaFileListFlavor, javaJVMLocalObjectMimeType, javaRemoteObjectMimeType, javaSerializedObjectMimeType, plainTextFlavor, selectionHtmlFlavor, stringFlavor`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GenericDataFlavor()`
  Construct a new GenericDataFlavor.
  `GenericDataFlavor(Class<?> representationClass, String humanPresentableName)`
  Construct a GenericDataFlavor that represents a Java class
  `GenericDataFlavor(String mimeType)`
  construct a GenericDataFlavor from a Mime Type string.
  `GenericDataFlavor(String mimeType, String humanPresentableName)`
  Construct a GenericDataFlavor that represents a MimeType If the mimeType is `"application/x-java-serialized-object; class=<representation class>", the result is the same as calling new GenericDataFlavor(Class:forName(<representation class>)`
  `GenericDataFlavor(String mimeType, String humanPresentableName, ClassLoader classLoader)`
  Construct a GenericDataFlavor that represents a MimeType If the mimeType is `"application/x-java-serialized-object; class=<representation class>", the result is the same as calling new GenericDataFlavor(Class:forName(<representation class>).`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(DataFlavor dataFlavor)`
  Return true if dataFlavor equals this generic data flavor.
  `boolean`
  `equals(Object obj)`
  Return true if obj is equal this generic data flavor.

  ### Methods inherited from class java.awt.datatransfer.DataFlavor

  `clone, equals, getDefaultRepresentationClass, getDefaultRepresentationClassAsString, getHumanPresentableName, getMimeType, getParameter, getPrimaryType, getReaderForText, getRepresentationClass, getSubType, getTextPlainUnicodeFlavor, hashCode, isFlavorJavaFileListType, isFlavorRemoteObjectType, isFlavorSerializedObjectType, isFlavorTextType, isMimeTypeEqual, isMimeTypeEqual, isMimeTypeSerializedObject, isRepresentationClassByteBuffer, isRepresentationClassCharBuffer, isRepresentationClassInputStream, isRepresentationClassReader, isRepresentationClassRemote, isRepresentationClassSerializable, match, normalizeMimeType, normalizeMimeTypeParameter, readExternal, selectBestTextFlavor, setHumanPresentableName, toString, tryToLoadClass, writeExternal`

  ### Methods inherited from class java.lang.Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### GenericDataFlavor

    public GenericDataFlavor()
    Construct a new GenericDataFlavor.

  - ### GenericDataFlavor

    public GenericDataFlavor(Class<?> representationClass, String humanPresentableName)
    Construct a GenericDataFlavor that represents a Java class
    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.

  - ### GenericDataFlavor

    public GenericDataFlavor(String mimeType) throws ClassNotFoundException
    construct a GenericDataFlavor from a Mime Type string.
    Parameters:
      `mimeType` - he string used to identify the MIME type for this flavor The string must specify a "class=" parameter in order to succeed in constructing a DataFlavor.
    Throws:
      `ClassNotFoundException` - if the class could not be loaded
      `IllegalArgumentException` - thrown if mimeType does not specify a "class=" parameter

  - ### GenericDataFlavor

    public GenericDataFlavor(String mimeType, String humanPresentableName)
    Construct a GenericDataFlavor that represents a MimeType If the mimeType is `"application/x-java-serialized-object; class=<representation class>", the result is the same as calling new GenericDataFlavor(Class:forName(<representation class>)`
    Parameters:
      `mimeType` - the string used to identify the MIME type for this flavor
      `humanPresentableName` - the human-readable string used to identify this flavor
    Throws:
      `IllegalArgumentException` - thrown if the mimeType does not specify a "class=" parameter, or if the class is not successfully loaded

  - ### GenericDataFlavor

    public GenericDataFlavor(String mimeType, String humanPresentableName, ClassLoader classLoader) throws ClassNotFoundException
    Construct a GenericDataFlavor that represents a MimeType If the mimeType is `"application/x-java-serialized-object; class=<representation class>", the result is the same as calling new GenericDataFlavor(Class:forName(<representation class>).`
    Parameters:
      `mimeType` - the string used to identify the MIME type for this flavor
      `humanPresentableName` - the human-readable string used to identify this flavor.
      `classLoader` - class loader to load the class
    Throws:
      `ClassNotFoundException` - is thrown if class could not be loaded

- ## Method Details

  - ### equals

    public boolean equals(DataFlavor dataFlavor)
    Return true if dataFlavor equals this generic data flavor.
    Overrides:
      `equals` in class `DataFlavor`

  - ### equals

    public boolean equals(Object obj)
    Return true if obj is equal this generic data flavor.
    Overrides:
      `equals` in class `DataFlavor`