javax.activation

Class DataHandler

Implemented Interfaces:
Transferable

public class DataHandler
extends java.lang.Object
implements Transferable

Constructor Summary

DataHandler(Object data, String type)
DataHandler(URL url)
DataHandler(DataSource ds)

Method Summary

CommandInfo[]
getAllCommands()
Object
getBean(CommandInfo cmdinfo)
CommandInfo
getCommand(String cmdName)
Object
getContent()
String
getContentType()
DataSource
getDataSource()
InputStream
getInputStream()
String
getName()
OutputStream
getOutputStream()
CommandInfo[]
getPreferredCommands()
Object
getTransferData(DataFlavor flavor)
DataFlavor[]
getTransferDataFlavors()
boolean
isDataFlavorSupported(DataFlavor flavor)
void
setCommandMap(CommandMap commandMap)
static void
setDataContentHandlerFactory(DataContentHandlerFactory newFactory)
Set the DataContentHandlerFactory to use.
void
writeTo(OutputStream os)

Constructor Details

DataHandler

public DataHandler(Object data,
                   String type)

DataHandler

public DataHandler(URL url)

DataHandler

public DataHandler(DataSource ds)

Method Details

getAllCommands

public CommandInfo[] getAllCommands()

getBean

public Object getBean(CommandInfo cmdinfo)

getCommand

public CommandInfo getCommand(String cmdName)

getContent

public Object getContent()
            throws IOException

getContentType

public String getContentType()

getDataSource

public DataSource getDataSource()

getInputStream

public InputStream getInputStream()
            throws IOException

getName

public String getName()

getOutputStream

public OutputStream getOutputStream()
            throws IOException

getPreferredCommands

public CommandInfo[] getPreferredCommands()

getTransferData

public Object getTransferData(DataFlavor flavor)
            throws UnsupportedFlavorException,
                   IOException

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor flavor)

setCommandMap

public void setCommandMap(CommandMap commandMap)

setDataContentHandlerFactory

public static void setDataContentHandlerFactory(DataContentHandlerFactory newFactory)
Set the DataContentHandlerFactory to use. If this method has already been called then an Error is raised.
Parameters:
newFactory - the new factory

writeTo

public void writeTo(OutputStream os)
            throws IOException