org.apache.axis2.format
Class TextFromElementDataSource

java.lang.Object
  extended by org.apache.axis2.format.TextFromElementDataSource
All Implemented Interfaces:
javax.activation.DataSource

public class TextFromElementDataSource
extends java.lang.Object
implements javax.activation.DataSource

Data source that represents the text of a given OMElement.

The expression

new TextFromElementDataSource(element, charset, contentType)
produces a DataSource implementation that is equivalent to
new ByteArrayDataSource(element.getText().getBytes(charset), contentType)
but that is more efficient.


Constructor Summary
TextFromElementDataSource(org.apache.axiom.om.OMElement element, java.lang.String charset, java.lang.String contentType)
           
 
Method Summary
 java.lang.String getContentType()
           
 java.io.InputStream getInputStream()
           
 java.lang.String getName()
           
 java.io.OutputStream getOutputStream()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextFromElementDataSource

public TextFromElementDataSource(org.apache.axiom.om.OMElement element,
                                 java.lang.String charset,
                                 java.lang.String contentType)
Method Detail

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in interface javax.activation.DataSource

getName

public java.lang.String getName()
Specified by:
getName in interface javax.activation.DataSource

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Specified by:
getInputStream in interface javax.activation.DataSource
Throws:
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Specified by:
getOutputStream in interface javax.activation.DataSource
Throws:
java.io.IOException


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.