- The DataHandler class provides a consistent interface to data available in many different sources and formats. It manages simple stream to string conversions and related operations using DataContentHandlers. It provides access to commands that can operate on the data. The commands are found using a CommandMap.
DataHandler and the Transferable Interface
DataHandler implements the Transferable interface so that data can be used in AWT data transfer operations, such as cut and paste and drag and drop. The implementation of the Transferable interface relies on the availability of an installed DataContentHandler object corresponding to the MIME type of the data represented in the specific instance of the DataHandler.
DataHandler and CommandMaps
The DataHandler keeps track of the current CommandMap that it uses to service requests for commands (
getPreferredCommands). Each instance of a DataHandler may have a CommandMap associated with it using the
setCommandMapmethod. If a CommandMap was not set, DataHandler calls the
getDefaultCommandMapmethod in CommandMap and uses the value it returns. See CommandMap for more information.
DataHandler and URLs
The current DataHandler implementation creates a private instance of URLDataSource when it is constructed with a URL.