com.sun.xml.ws.encoding
Class StringDataContentHandler

java.lang.Object
  extended by com.sun.xml.ws.encoding.StringDataContentHandler
All Implemented Interfaces:
javax.activation.DataContentHandler

public class StringDataContentHandler
extends Object
implements javax.activation.DataContentHandler

JavaMail's data content handler for text/plain -->String


Constructor Summary
StringDataContentHandler()
           
 
Method Summary
 Object getContent(javax.activation.DataSource ds)
           
protected  javax.activation.ActivationDataFlavor getDF()
           
 Object getTransferData(DataFlavor df, javax.activation.DataSource ds)
          Return the Transfer Data of type DataFlavor from InputStream.
 DataFlavor[] getTransferDataFlavors()
          Return the DataFlavors for this DataContentHandler.
 void writeTo(Object obj, String type, OutputStream os)
          Write the object to the output stream, using the specified MIME type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringDataContentHandler

public StringDataContentHandler()
Method Detail

getDF

protected javax.activation.ActivationDataFlavor getDF()

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Return the DataFlavors for this DataContentHandler.

Specified by:
getTransferDataFlavors in interface javax.activation.DataContentHandler
Returns:
The DataFlavors

getTransferData

public Object getTransferData(DataFlavor df,
                              javax.activation.DataSource ds)
                       throws IOException
Return the Transfer Data of type DataFlavor from InputStream.

Specified by:
getTransferData in interface javax.activation.DataContentHandler
Parameters:
df - The DataFlavor
ds - The DataSource corresponding to the data
Returns:
String object
Throws:
IOException

getContent

public Object getContent(javax.activation.DataSource ds)
                  throws IOException
Specified by:
getContent in interface javax.activation.DataContentHandler
Throws:
IOException

writeTo

public void writeTo(Object obj,
                    String type,
                    OutputStream os)
             throws IOException
Write the object to the output stream, using the specified MIME type.

Specified by:
writeTo in interface javax.activation.DataContentHandler
Throws:
IOException


Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.