Package com.sun.xml.messaging.saaj.soap
Class XmlDataContentHandler
java.lang.Object
com.sun.xml.messaging.saaj.soap.XmlDataContentHandler
- All Implemented Interfaces:
DataContentHandler
JAF data handler for XML content
- Author:
- Anil Vijendran
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContent(DataSource dataSource) Return an object representing the data in its most preferred form.getTransferData(ActivationDataFlavor flavor, DataSource dataSource) return the Transfer Data of type DataFlavor from InputStreamreturn the DataFlavors for thisDataContentHandlervoidwriteTo(Object obj, String mimeType, OutputStream os) construct an object from a byte stream (similar semantically to previous method, we are deciding which one to support)
-
Constructor Details
-
XmlDataContentHandler
public XmlDataContentHandler()
-
-
Method Details
-
getTransferDataFlavors
return the DataFlavors for thisDataContentHandler- Specified by:
getTransferDataFlavorsin interfaceDataContentHandler- Returns:
- The DataFlavors.
-
getTransferData
public Object getTransferData(ActivationDataFlavor flavor, DataSource dataSource) throws IOException return the Transfer Data of type DataFlavor from InputStream- Specified by:
getTransferDatain interfaceDataContentHandler- Parameters:
flavor- The DataFlavor.dataSource- The DataSource.- Returns:
- The constructed Object.
- Throws:
IOException- if the handler doesn't support the requested flavor
-
getContent
Description copied from interface:DataContentHandlerReturn an object representing the data in its most preferred form. Generally this will be the form described by the first ActivationDataFlavor returned by thegetTransferDataFlavorsmethod.- Specified by:
getContentin interfaceDataContentHandler- Parameters:
dataSource- The DataSource representing the data to be converted.- Returns:
- The constructed Object.
- Throws:
IOException- if the data can't be accessed
-
writeTo
construct an object from a byte stream (similar semantically to previous method, we are deciding which one to support)- Specified by:
writeToin interfaceDataContentHandler- Parameters:
obj- The object to be converted.mimeType- The requested MIME type of the resulting byte stream.os- The output stream into which to write the converted byte stream.- Throws:
IOException- errors writing to the stream
-