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 DataContentHandler
ds
- the activation datasourceIOException
public 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 DataContentHandler
df
- the flavor specifiying the mime type of dsds
- the activation data sourceUnsupportedFlavorException
IOException
public DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors
in interface DataContentHandler
ActivationDataHandlers
public 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 DataContentHandler
obj
- an XML stream sourcemimeType
- the string "text/xml"os
- the output stream to write this xml stream toIOException
Copyright © 2013 JBoss, by Red Hat. All Rights Reserved.