Java Doc for DataFlavor.java in  » 6.0-JDK-Modules » j2me » java » awt » datatransfer » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » java.awt.datatransfer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.datatransfer.DataFlavor

DataFlavor
public class DataFlavor implements Externalizable,Cloneable(Code)
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.


version:
   1.53, 02/09/01
author:
   Blake Sullivan
author:
   Laurence P. G. Cable
author:
   Jeff Dunn


Field Summary
transient  intatom
    
 MimeTypemimeType
    
final public static  DataFlavorplainTextFlavor
     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.

final public static  DataFlavorstringFlavor
    

Constructor Summary
public  DataFlavor()
     Constructs a new DataFlavor.
 DataFlavor(DataFlavor that)
     Cloning constructor.
public  DataFlavor(Class representationClass, String humanPresentableName)
    
public  DataFlavor(String mimeType, String humanPresentableName)
    

Method Summary
public  Objectclone()
    
public  booleanequals(Object o)
     If the object is an instance of DataFlavor, representationClass and MIME type will be compared.
public  booleanequals(DataFlavor that)
     Two DataFlavors are considered equal if and only if their MIME primary type and subtype and representation class are equal.
public  StringgetHumanPresentableName()
     Returns the human presentable name for the data foramt that this DataFlavor represents.
public  StringgetMimeType()
    
public  StringgetPrimaryType()
     Returns the primary MIME type for this DataFlavor.
public  ClassgetRepresentationClass()
     Returns the Class which objects supporting this DataFlavor will return when this DataFlavor is requested.
public  StringgetSubType()
     Returns the sub MIME type of this DataFlavor.
public  inthashCode()
     Returns hash code for this DataFlavor. For two equal DataFlavors, hash codes are equal.
public  booleanisMimeTypeEqual(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 incuded in the comparison.
final public  booleanisMimeTypeEqual(DataFlavor dataFlavor)
    
public  booleanmatch(DataFlavor that)
     Two DataFlavors match if their primary types, subtypes, and representation classes are all equal.
protected  StringnormalizeMimeType(String mimeType)
     Called for each MIME type string to give DataFlavor subtypes the opportunity to change how the normalization of MIME types is accomplished.
protected  StringnormalizeMimeTypeParameter(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.
public synchronized  voidreadExternal(ObjectInput is)
    
public  voidsetHumanPresentableName(String humanPresentableName)
     Sets the human presentable name for the data format that this DataFlavor represents.
public  StringtoString()
     String representation of this DataFlavor and its parameters.
public synchronized  voidwriteExternal(ObjectOutput os)
    

Field Detail
atom
transient int atom(Code)



mimeType
MimeType mimeType(Code)



plainTextFlavor
final public static DataFlavor plainTextFlavor(Code)
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.




stringFlavor
final public static DataFlavor stringFlavor(Code)
The DataFlavor representing a Java Unicode String class, where:

representationClass = java.lang.String
mimeType = "application/x-java-serialized-object"





Constructor Detail
DataFlavor
public DataFlavor()(Code)
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
DataFlavor(DataFlavor that)(Code)
Cloning constructor. Package-private.



DataFlavor
public DataFlavor(Class representationClass, String humanPresentableName)(Code)
Construct 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
Parameters:
  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.




DataFlavor
public DataFlavor(String mimeType, String humanPresentableName)(Code)
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


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 successfullyloaded, then an IllegalArgumentException is thrown.
Parameters:
  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.





Method Detail
clone
public Object clone() throws CloneNotSupportedException(Code)
a clone of this DataFlavor



equals
public boolean equals(Object o)(Code)
If the object is an instance of DataFlavor, representationClass and MIME type will be compared. This method does not use equals(String) method, so it does not return true for the objects of String type. if the objects are equal



equals
public boolean equals(DataFlavor that)(Code)
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 charset parameter must also be equal. If either DataFlavor is of primary type "text", but no charset is specified, the platform default charset is assumed for that DataFlavor. if the DataFlavors represent exactly the same type.



getHumanPresentableName
public String getHumanPresentableName()(Code)
Returns the human presentable name for the data foramt that this DataFlavor represents. This name would be localized for different countries



getMimeType
public String getMimeType()(Code)
Returns the MIME type string for this DataFlavor



getPrimaryType
public String getPrimaryType()(Code)
Returns the primary MIME type for this DataFlavor. the primary MIME type of this DataFlavor



getRepresentationClass
public Class getRepresentationClass()(Code)
Returns the Class which objects supporting this DataFlavor will return when this DataFlavor is requested.



getSubType
public String getSubType()(Code)
Returns the sub MIME type of this DataFlavor. the Sub MIME type of this DataFlavor



hashCode
public int hashCode()(Code)
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. a hash code for this DataFlavor



isMimeTypeEqual
public boolean isMimeTypeEqual(String mimeType)(Code)
Returns whether the string representation of the MIME type passed in is equivalent to the MIME type of this DataFlavor. Parameters are not incuded in the comparison. The comparison may involve adding default attributes for some MIME types (such as adding charset=US-ASCII to text/plain MIME types that have no charset parameter specified).
Parameters:
  mimeType - the string representation of the MIME type true if the string representation of the MIME type passed in isequivalent to the MIME type of this DataFlavor;false otherwise.
throws:
  NullPointerException - if mimeType is null



isMimeTypeEqual
final public boolean isMimeTypeEqual(DataFlavor dataFlavor)(Code)
Compare the mimeType of two DataFlavor objects no parameters are considered if the MimeTypes are equal



match
public boolean match(DataFlavor that)(Code)
Two DataFlavors match if their primary types, subtypes, and representation classes are all equal. Additionally, if the primary type is "text", the charset parameter is also considered. If either DataFlavor is of primary type "text", but no charset is specified, the platform default charset is assumed for that DataFlavor.



normalizeMimeType
protected String normalizeMimeType(String mimeType)(Code)
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



normalizeMimeTypeParameter
protected String normalizeMimeTypeParameter(String parameterName, String parameterValue)(Code)
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




readExternal
public synchronized void readExternal(ObjectInput is) throws IOException, ClassNotFoundException(Code)
restore this DataFlavor from an Serialized state



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



toString
public String toString()(Code)
String representation of this DataFlavor and its parameters. The result String contains name of DataFlavor class, representation class and Mime type of this Flavor. string representation of this DataFlavor



writeExternal
public synchronized void writeExternal(ObjectOutput os) throws IOException(Code)
Serialize this DataFlavor



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.