public class XmlDataContentHandler extends Object implements DataContentHandler
XmlDataContentHandler is a JAF content handler that provides
marchalling/unmarshalling between a StreamSource and a generic
stream.| Constructor and Description |
|---|
XmlDataContentHandler() |
| Modifier and Type | Method and Description |
|---|---|
Object |
getContent(DataSource ds)
Returns a
StreamSource from the specified
data source. |
Object |
getTransferData(DataFlavor df,
DataSource ds)
Returns a
StreamSource from the specified
data source. |
DataFlavor[] |
getTransferDataFlavors()
Returns the acceptable data flavors that this content handler supports.
|
void |
writeTo(Object obj,
String mimeType,
OutputStream os)
Writes the passed in
StreamSource object using the specified
mime type to the specified output stream. |
public Object getContent(DataSource ds) throws IOException
StreamSource from the specified
data source.getContent in interface DataContentHandlerds - the activation datasourceIOExceptionpublic Object getTransferData(DataFlavor df, DataSource ds) throws UnsupportedFlavorException, IOException
StreamSource from the specified
data source. The flavor must be one of the ones returned by getTransferDataFlavors().getTransferData in interface DataContentHandlerdf - the flavor specifiying the mime type of dsds - the activation data sourceUnsupportedFlavorExceptionIOExceptionpublic DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors in interface DataContentHandlerActivationDataHandlerspublic void writeTo(Object obj, String mimeType, OutputStream os) throws IOException
StreamSource object using the specified
mime type to the specified output stream. The mime type must be text/xml.writeTo in interface DataContentHandlerobj - an XML stream sourcemimeType - the string "text/xml"os - the output stream to write this xml stream toIOExceptionCopyright © 2012 JBoss, by Red Hat. All Rights Reserved.