|
Java Platform 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.datatransfer.DataFlavor
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.
Field Summary | |
static 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 |
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 Transferble. |
static 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. |
static String |
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 |
plainTextFlavor
The DataFlavor representing plain text with unicode encoding, where: representationClass = InputStream mimeType = "text/plain; charset=unicode" |
static DataFlavor |
stringFlavor
The DataFlavor representing a Java Unicode String class, where: representationClass = java.lang.String mimeType = "application/x-java-serialized-object" |
Constructor Summary | |
DataFlavor()
|
|
DataFlavor(Class representationClass,
String humanPresentableName)
Construct a DataFlavor that represents a Java class The returned DataFlavor will have the following characteristics representationClass = representationClass mimeType = application/x-java-serialized-object |
|
DataFlavor(String mimeType)
construct a DataFlavor from a Mime Type string. |
|
DataFlavor(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=<representation class>", the result is the same as calling new DataFlavor(Class:forName(<representation class>) as above otherwise: representationClass = InputStream mimeType = mimeType |
|
DataFlavor(String mimeType,
String humanPresentableName,
ClassLoader classLoader)
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=<representation class>", the result is the same as calling new DataFlavor(Class:forName(<representation class>) as above otherwise: representationClass = InputStream mimeType = mimeType |
Method Summary | |
Object |
clone()
|
boolean |
equals(DataFlavor dataFlavor)
|
boolean |
equals(Object o)
|
boolean |
equals(String s)
|
String |
getHumanPresentableName()
Returns the human presentable name for the data foramt that this DataFlavor represents. |
String |
getMimeType()
Returns the MIME type string for this DataFlavor |
String |
getParameter(String paramName)
|
String |
getPrimaryType()
|
Class |
getRepresentationClass()
Returns the Class which objects supporting this DataFlavor will return when this DataFlavor is requested. |
String |
getSubType()
|
boolean |
isFlavorJavaFileListType()
|
boolean |
isFlavorRemoteObjectType()
|
boolean |
isFlavorSerializedObjectType()
|
boolean |
isMimeTypeEqual(DataFlavor dataFlavor)
|
boolean |
isMimeTypeEqual(String mimeType)
Is the string representation of the MIME type passed in equivalent to the MIME type of this DataFlavor. |
boolean |
isMimeTypeSerializedObject()
does the DataFlavor represent a serialized object? |
boolean |
isRepresentationClassInputStream()
does the DataFlavor represent a java.io.InputStream |
boolean |
isRepresentationClassRemote()
|
boolean |
isRepresentationClassSerializable()
|
protected String |
normalizeMimeType(String mimeType)
Deprecated. |
protected String |
normalizeMimeTypeParameter(String parameterName,
String parameterValue)
Deprecated. |
void |
readExternal(ObjectInput is)
restore this DataFlavor from an Serialized state |
void |
setHumanPresentableName(String humanPresentableName)
Sets the human presentable name for the data format that this DataFlavor represents. |
protected static Class |
tryToLoadClass(String className,
ClassLoader fallback)
tried 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(ObjectOutput os)
Serialize this DataFlavor |
Methods inherited from class java.lang.Object |
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final DataFlavor stringFlavor
representationClass = java.lang.String
mimeType = "application/x-java-serialized-object"
public static final DataFlavor plainTextFlavor
representationClass = InputStream
mimeType = "text/plain; charset=unicode"
public static final String javaSerializedObjectMimeType
public static final DataFlavor javaFileListFlavor
public static final String javaJVMLocalObjectMimeType
public static final String javaRemoteObjectMimeType
Constructor Detail |
public DataFlavor(Class representationClass, String humanPresentableName)
The returned DataFlavor will have the following characteristics
representationClass = representationClass
mimeType = application/x-java-serialized-object
representationClass
- the class used to transfer data in this flavorhumanPresentableName
- 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.public DataFlavor(String mimeType, String humanPresentableName)
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>) as above
otherwise:
representationClass = InputStream
mimeType = mimeType
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.public DataFlavor(String mimeType, String humanPresentableName, ClassLoader classLoader) throws ClassNotFoundException
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>) as above
otherwise:
representationClass = InputStream
mimeType = mimeType
mimeType
- the string used to identify the MIME type for this flavorhumanPresentableName
- the human-readible string used to identify this flavorpublic DataFlavor(String mimeType) throws ClassNotFoundException
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.public DataFlavor()
Method Detail |
protected static final Class tryToLoadClass(String className, ClassLoader fallback) throws ClassNotFoundException
fallback
- the fallback loaderpublic String getMimeType()
public Class getRepresentationClass()
public String getHumanPresentableName()
public String getPrimaryType()
public String getSubType()
public String getParameter(String paramName)
public void setHumanPresentableName(String humanPresentableName)
public boolean equals(Object o)
public boolean equals(DataFlavor dataFlavor)
public boolean equals(String s)
public boolean isMimeTypeEqual(String mimeType)
public final boolean isMimeTypeEqual(DataFlavor dataFlavor)
public boolean isMimeTypeSerializedObject()
public boolean isRepresentationClassInputStream()
public boolean isRepresentationClassSerializable()
public boolean isRepresentationClassRemote()
public boolean isFlavorSerializedObjectType()
public boolean isFlavorRemoteObjectType()
public boolean isFlavorJavaFileListType()
public void writeExternal(ObjectOutput os) throws IOException
public void readExternal(ObjectInput is) throws IOException, ClassNotFoundException
public Object clone() throws CloneNotSupportedException
protected String normalizeMimeTypeParameter(String parameterName, String parameterValue)
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
protected String normalizeMimeType(String mimeType)
|
Java Platform 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |