Package com.sun.xml.messaging.saaj.soap
Class StringDataContentHandler
java.lang.Object
com.sun.xml.messaging.saaj.soap.StringDataContentHandler
- All Implemented Interfaces:
DataContentHandler
JAF data content handler for text/plain --> String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContent(DataSource ds) Return an object representing the data in its most preferred form.protected ActivationDataFlavorgetDF()Return the Transfer Data of type DataFlavor from InputStream.Return the DataFlavors for thisDataContentHandler.voidwriteTo(Object obj, String type, OutputStream os) Write the object to the output stream, using the specified MIME type.
-
Constructor Details
-
StringDataContentHandler
public StringDataContentHandler()
-
-
Method Details
-
getDF
-
getTransferDataFlavors
Return the DataFlavors for thisDataContentHandler.- Specified by:
getTransferDataFlavorsin interfaceDataContentHandler- Returns:
- The DataFlavors
-
getTransferData
Return the Transfer Data of type DataFlavor from InputStream.- Specified by:
getTransferDatain interfaceDataContentHandler- Parameters:
df- The DataFlavords- The DataSource corresponding to the data- Returns:
- String 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:
ds- The DataSource representing the data to be converted.- Returns:
- The constructed Object.
- Throws:
IOException- if the data can't be accessed
-
writeTo
Write the object to the output stream, using the specified MIME type.- Specified by:
writeToin interfaceDataContentHandler- Parameters:
obj- The object to be converted.type- 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
-