org.apache.axis2.util
Class WrappedDataHandler

java.lang.Object
  extended by javax.activation.DataHandler
      extended by org.apache.axis2.util.WrappedDataHandler
All Implemented Interfaces:
Transferable

public class WrappedDataHandler
extends DataHandler

This class acts as a wrapper for the javax.activation.DataHandler class. It is used to store away a (potentially) user-defined content-type value along with the DataHandler instance. We'll delegate all method calls except for getContentType() to the real DataHandler instance.


Constructor Summary
WrappedDataHandler(DataHandler _delegate, String _contentType)
          Constructs a new instance of the WrappedDataHandler.
 
Method Summary
 CommandInfo[] getAllCommands()
           
 Object getBean(CommandInfo paramCommandInfo)
           
 CommandInfo getCommand(String paramString)
           
 Object getContent()
           
 String getContentType()
           
 DataSource getDataSource()
           
 InputStream getInputStream()
           
 String getName()
           
 OutputStream getOutputStream()
           
 CommandInfo[] getPreferredCommands()
           
 Object getTransferData(DataFlavor paramDataFlavor)
           
 DataFlavor[] getTransferDataFlavors()
           
 boolean isDataFlavorSupported(DataFlavor paramDataFlavor)
           
 void setCommandMap(CommandMap paramCommandMap)
           
 void writeTo(OutputStream paramOutputStream)
           
 
Methods inherited from class javax.activation.DataHandler
setDataContentHandlerFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrappedDataHandler

public WrappedDataHandler(DataHandler _delegate,
                          String _contentType)
Constructs a new instance of the WrappedDataHandler.

Parameters:
_delegate - the real DataHandler instance being wrapped
_contentType - the user-defined contentType associated with the DataHandler instance
Method Detail

getAllCommands

public CommandInfo[] getAllCommands()
Overrides:
getAllCommands in class DataHandler

getBean

public Object getBean(CommandInfo paramCommandInfo)
Overrides:
getBean in class DataHandler

getCommand

public CommandInfo getCommand(String paramString)
Overrides:
getCommand in class DataHandler

getContent

public Object getContent()
                  throws IOException
Overrides:
getContent in class DataHandler
Throws:
IOException

getContentType

public String getContentType()
Overrides:
getContentType in class DataHandler

getDataSource

public DataSource getDataSource()
Overrides:
getDataSource in class DataHandler

getInputStream

public InputStream getInputStream()
                           throws IOException
Overrides:
getInputStream in class DataHandler
Throws:
IOException

getName

public String getName()
Overrides:
getName in class DataHandler

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Overrides:
getOutputStream in class DataHandler
Throws:
IOException

getPreferredCommands

public CommandInfo[] getPreferredCommands()
Overrides:
getPreferredCommands in class DataHandler

getTransferData

public Object getTransferData(DataFlavor paramDataFlavor)
                       throws UnsupportedFlavorException,
                              IOException
Specified by:
getTransferData in interface Transferable
Overrides:
getTransferData in class DataHandler
Throws:
UnsupportedFlavorException
IOException

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Specified by:
getTransferDataFlavors in interface Transferable
Overrides:
getTransferDataFlavors in class DataHandler

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor paramDataFlavor)
Specified by:
isDataFlavorSupported in interface Transferable
Overrides:
isDataFlavorSupported in class DataHandler

setCommandMap

public void setCommandMap(CommandMap paramCommandMap)
Overrides:
setCommandMap in class DataHandler

writeTo

public void writeTo(OutputStream paramOutputStream)
             throws IOException
Overrides:
writeTo in class DataHandler
Throws:
IOException


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.