Java Doc for SystemFlavorMap.java in  » 6.0-JDK-Core » AWT » java » awt » datatransfer » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
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
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » AWT » java.awt.datatransfer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.datatransfer.SystemFlavorMap

SystemFlavorMap
final public class SystemFlavorMap implements FlavorMap,FlavorTable(Code)
The SystemFlavorMap is a configurable map between "natives" (Strings), which correspond to platform-specific data formats, and "flavors" (DataFlavors), which correspond to platform-independent MIME types. This mapping is used by the data transfer subsystem to transfer data between Java and native applications, and between Java applications in separate VMs.

In the Sun reference implementation, the default SystemFlavorMap is initialized by the file jre/lib/flavormap.properties and the contents of the URL referenced by the AWT property AWT.DnD.flavorMapFileURL. See flavormap.properties for details.
version:
   1.44, 05/05/07
since:
   1.2





Method Summary
public synchronized  voidaddFlavorForUnencodedNative(String nat, DataFlavor flav)
     Adds a mapping from a single String native to a single DataFlavor.
public synchronized  voidaddUnencodedNativeForFlavor(DataFlavor flav, String nat)
     Adds a mapping from the specified DataFlavor (and all DataFlavors equal to the specified DataFlavor) to the specified String native. Unlike getNativesForFlavor, the mapping will only be established in one direction, and the native will not be encoded.
public static  DataFlavordecodeDataFlavor(String nat)
     Decodes a String native for use as a DataFlavor.
public static  StringdecodeJavaMIMEType(String nat)
     Decodes a String native for use as a Java MIME type.
public static  StringencodeDataFlavor(DataFlavor flav)
     Encodes a DataFlavor for use as a String native.
public static  StringencodeJavaMIMEType(String mimeType)
     Encodes a MIME type for use as a String native.
public static  FlavorMapgetDefaultFlavorMap()
     Returns the default FlavorMap for this thread's ClassLoader.
public synchronized  List<DataFlavor>getFlavorsForNative(String nat)
     Returns a List of DataFlavors to which the specified String native can be translated by the data transfer subsystem.
public synchronized  Map<String, DataFlavor>getFlavorsForNatives(String[] natives)
     Returns a Map of the specified String natives to their most preferred DataFlavor.
public synchronized  List<String>getNativesForFlavor(DataFlavor flav)
     Returns a List of String natives to which the specified DataFlavor can be translated by the data transfer subsystem.
public synchronized  Map<DataFlavor, String>getNativesForFlavors(DataFlavor[] flavors)
     Returns a Map of the specified DataFlavors to their most preferred String native.
public static  booleanisJavaMIMEType(String str)
     Returns whether the specified String is an encoded Java MIME type.
public synchronized  voidsetFlavorsForNative(String nat, DataFlavor[] flavors)
     Discards the current mappings for the specified String native, and creates new mappings to the specified DataFlavors.
public synchronized  voidsetNativesForFlavor(DataFlavor flav, String[] natives)
     Discards the current mappings for the specified DataFlavor and all DataFlavors equal to the specified DataFlavor, and creates new mappings to the specified String natives. Unlike getNativesForFlavor, the mappings will only be established in one direction, and the natives will not be encoded.



Method Detail
addFlavorForUnencodedNative
public synchronized void addFlavorForUnencodedNative(String nat, DataFlavor flav)(Code)
Adds a mapping from a single String native to a single DataFlavor. Unlike getFlavorsForNative, the mapping will only be established in one direction, and the native will not be encoded. To establish a two-way mapping, call addUnencodedNativeForFlavor as well. The new mapping will be of lower priority than any existing mapping. This method has no effect if a mapping from the specified String native to the specified or equal DataFlavor already exists.
Parameters:
  nat - the String native key for the mapping
Parameters:
  flav - the DataFlavor value for the mapping
throws:
  NullPointerException - if nat or flav is null
See Also:   SystemFlavorMap.addUnencodedNativeForFlavor
since:
   1.4



addUnencodedNativeForFlavor
public synchronized void addUnencodedNativeForFlavor(DataFlavor flav, String nat)(Code)
Adds a mapping from the specified DataFlavor (and all DataFlavors equal to the specified DataFlavor) to the specified String native. Unlike getNativesForFlavor, the mapping will only be established in one direction, and the native will not be encoded. To establish a two-way mapping, call addFlavorForUnencodedNative as well. The new mapping will be of lower priority than any existing mapping. This method has no effect if a mapping from the specified or equal DataFlavor to the specified String native already exists.
Parameters:
  flav - the DataFlavor key for the mapping
Parameters:
  nat - the String native value for the mapping
throws:
  NullPointerException - if flav or nat is null
See Also:   SystemFlavorMap.addFlavorForUnencodedNative
since:
   1.4



decodeDataFlavor
public static DataFlavor decodeDataFlavor(String nat) throws ClassNotFoundException(Code)
Decodes a String native for use as a DataFlavor.
Parameters:
  nat - the String to decode the decoded DataFlavor, or null ifnat is not an encoded String native



decodeJavaMIMEType
public static String decodeJavaMIMEType(String nat)(Code)
Decodes a String native for use as a Java MIME type.
Parameters:
  nat - the String to decode the decoded Java MIME type, or null if nat is notan encoded String native



encodeDataFlavor
public static String encodeDataFlavor(DataFlavor flav)(Code)
Encodes a DataFlavor for use as a String native. The format of an encoded DataFlavor is implementation-dependent. The only restrictions are:
  • The encoded representation is null if and only if the specified DataFlavor is null or its MIME type String is null.
  • The encoded representations for two non-null DataFlavors with non-null MIME type Strings are equal if and only if the MIME type Strings of these DataFlavors are equal according to String.equals(Object).

Sun's reference implementation of this method returns the MIME type String of the specified DataFlavor prefixed with JAVA_DATAFLAVOR:.
Parameters:
  flav - the DataFlavor to encode the encoded String, or null ifflav is null or has a null MIME type




encodeJavaMIMEType
public static String encodeJavaMIMEType(String mimeType)(Code)
Encodes a MIME type for use as a String native. The format of an encoded representation of a MIME type is implementation-dependent. The only restrictions are:
  • The encoded representation is null if and only if the MIME type String is null.
  • The encoded representations for two non-null MIME type Strings are equal if and only if these Strings are equal according to String.equals(Object).

Sun's reference implementation of this method returns the specified MIME type String prefixed with JAVA_DATAFLAVOR:.
Parameters:
  mimeType - the MIME type to encode the encoded String, or null ifmimeType is null




getDefaultFlavorMap
public static FlavorMap getDefaultFlavorMap()(Code)
Returns the default FlavorMap for this thread's ClassLoader.



getFlavorsForNative
public synchronized List<DataFlavor> getFlavorsForNative(String nat)(Code)
Returns a List of DataFlavors to which the specified String native can be translated by the data transfer subsystem. The List will be sorted from best DataFlavor to worst. That is, the first DataFlavor will best reflect data in the specified native to a Java application.

If the specified native is previously unknown to the data transfer subsystem, and that native has been properly encoded, then invoking this method will establish a mapping in both directions between the specified native and a DataFlavor whose MIME type is a decoded version of the native.

If the specified native is not a properly encoded native and the mappings for this native have not been altered with setFlavorsForNative, then the contents of the List is platform dependent, but null cannot be returned.
Parameters:
  nat - the native whose corresponding DataFlavorsshould be returned. If null is specified, allDataFlavors currently known to the data transfersubsystem are returned in a non-deterministic order. a java.util.List of DataFlavorobjects into which platform-specific data in the specified,platform-specific native can be translated
See Also:   SystemFlavorMap.encodeJavaMIMEType
since:
   1.4




getFlavorsForNatives
public synchronized Map<String, DataFlavor> getFlavorsForNatives(String[] natives)(Code)
Returns a Map of the specified String natives to their most preferred DataFlavor. Each DataFlavor value will be the same as the first DataFlavor in the List returned by getFlavorsForNative for the specified native.

If a specified native is previously unknown to the data transfer subsystem, and that native has been properly encoded, then invoking this method will establish a mapping in both directions between the specified native and a DataFlavor whose MIME type is a decoded version of the native.
Parameters:
  natives - an array of Strings which will be thekey set of the returned Map. If null isspecified, a mapping of all supported String nativesto their most preferred DataFlavors will bereturned. a java.util.Map of String natives toDataFlavors
See Also:   SystemFlavorMap.getFlavorsForNative
See Also:   SystemFlavorMap.encodeJavaMIMEType




getNativesForFlavor
public synchronized List<String> getNativesForFlavor(DataFlavor flav)(Code)
Returns a List of String natives to which the specified DataFlavor can be translated by the data transfer subsystem. The List will be sorted from best native to worst. That is, the first native will best reflect data in the specified flavor to the underlying native platform.

If the specified DataFlavor is previously unknown to the data transfer subsystem and the data transfer subsystem is unable to translate this DataFlavor to any existing native, then invoking this method will establish a mapping in both directions between the specified DataFlavor and an encoded version of its MIME type as its native.
Parameters:
  flav - the DataFlavor whose corresponding nativesshould be returned. If null is specified, allnatives currently known to the data transfer subsystem arereturned in a non-deterministic order. a java.util.List of java.lang.Stringobjects which are platform-specific representations of platform-specific data formats
See Also:   SystemFlavorMap.encodeDataFlavor
since:
   1.4




getNativesForFlavors
public synchronized Map<DataFlavor, String> getNativesForFlavors(DataFlavor[] flavors)(Code)
Returns a Map of the specified DataFlavors to their most preferred String native. Each native value will be the same as the first native in the List returned by getNativesForFlavor for the specified flavor.

If a specified DataFlavor is previously unknown to the data transfer subsystem, then invoking this method will establish a mapping in both directions between the specified DataFlavor and an encoded version of its MIME type as its native.
Parameters:
  flavors - an array of DataFlavors which will be thekey set of the returned Map. If null isspecified, a mapping of all DataFlavors known to thedata transfer subsystem to their most preferred String natives will be returned. a java.util.Map of DataFlavors toString natives
See Also:   SystemFlavorMap.getNativesForFlavor
See Also:   SystemFlavorMap.encodeDataFlavor




isJavaMIMEType
public static boolean isJavaMIMEType(String str)(Code)
Returns whether the specified String is an encoded Java MIME type.
Parameters:
  str - the String to test true if the String is encoded;false otherwise



setFlavorsForNative
public synchronized void setFlavorsForNative(String nat, DataFlavor[] flavors)(Code)
Discards the current mappings for the specified String native, and creates new mappings to the specified DataFlavors. Unlike getFlavorsForNative, the mappings will only be established in one direction, and the natives need not be encoded. To establish two-way mappings, call setNativesForFlavor as well. The first DataFlavor in the array will represent the highest priority mapping. Subsequent DataFlavors will represent mappings of decreasing priority.

If the array contains several elements that reference equal DataFlavors, this method will establish new mappings for the first of those elements and ignore the rest of them.

It is recommended that client code not reset mappings established by the data transfer subsystem. This method should only be used for application-level mappings.
Parameters:
  nat - the String native key for the mappings
Parameters:
  flavors - the DataFlavor values for the mappings
throws:
  NullPointerException - if nat or flavors is nullor if flavors contains null elements
See Also:   SystemFlavorMap.setNativesForFlavor
since:
   1.4




setNativesForFlavor
public synchronized void setNativesForFlavor(DataFlavor flav, String[] natives)(Code)
Discards the current mappings for the specified DataFlavor and all DataFlavors equal to the specified DataFlavor, and creates new mappings to the specified String natives. Unlike getNativesForFlavor, the mappings will only be established in one direction, and the natives will not be encoded. To establish two-way mappings, call setFlavorsForNative as well. The first native in the array will represent the highest priority mapping. Subsequent natives will represent mappings of decreasing priority.

If the array contains several elements that reference equal String natives, this method will establish new mappings for the first of those elements and ignore the rest of them.

It is recommended that client code not reset mappings established by the data transfer subsystem. This method should only be used for application-level mappings.
Parameters:
  flav - the DataFlavor key for the mappings
Parameters:
  natives - the String native values for the mappings
throws:
  NullPointerException - if flav or natives is nullor if natives contains null elements
See Also:   SystemFlavorMap.setFlavorsForNative
since:
   1.4




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(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.