Package com.sun.mail.handlers
Class text_xml
- java.lang.Object
-
- com.sun.mail.handlers.handler_base
-
- com.sun.mail.handlers.text_plain
-
- com.sun.mail.handlers.text_xml
-
- All Implemented Interfaces:
DataContentHandler
public class text_xml extends text_plain
DataContentHandler for text/xml.
-
-
Field Summary
Fields Modifier and Type Field Description private static ActivationDataFlavor[]
flavors
-
Constructor Summary
Constructors Constructor Description text_xml()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
getData(ActivationDataFlavor aFlavor, DataSource ds)
Given the flavor that matched, return the appropriate type of object.protected ActivationDataFlavor[]
getDataFlavors()
Return an array of ActivationDataFlavors that we support.private boolean
isXmlType(java.lang.String type)
void
writeTo(java.lang.Object obj, java.lang.String mimeType, java.io.OutputStream os)
Write the object to the output stream, using the specified MIME type.-
Methods inherited from class com.sun.mail.handlers.text_plain
getContent
-
Methods inherited from class com.sun.mail.handlers.handler_base
getTransferData, getTransferDataFlavors
-
-
-
-
Field Detail
-
flavors
private static final ActivationDataFlavor[] flavors
-
-
Method Detail
-
getDataFlavors
protected ActivationDataFlavor[] getDataFlavors()
Description copied from class:handler_base
Return an array of ActivationDataFlavors that we support. Usually there will be only one.- Overrides:
getDataFlavors
in classtext_plain
- Returns:
- array of ActivationDataFlavors that we support
-
getData
protected java.lang.Object getData(ActivationDataFlavor aFlavor, DataSource ds) throws java.io.IOException
Description copied from class:handler_base
Given the flavor that matched, return the appropriate type of object. Usually there's only one flavor so just call getContent.- Overrides:
getData
in classhandler_base
- Parameters:
aFlavor
- the ActivationDataFlavords
- DataSource containing the data- Returns:
- the object
- Throws:
java.io.IOException
- for errors reading the data
-
writeTo
public void writeTo(java.lang.Object obj, java.lang.String mimeType, java.io.OutputStream os) throws java.io.IOException
Description copied from class:text_plain
Write the object to the output stream, using the specified MIME type.- Specified by:
writeTo
in interfaceDataContentHandler
- Overrides:
writeTo
in classtext_plain
- 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:
java.io.IOException
- errors writing to the stream
-
isXmlType
private boolean isXmlType(java.lang.String type)
-
-