org.apache.axis2.format
Class TextFromElementDataSource
java.lang.Object
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextFromElementDataSource
public TextFromElementDataSource(org.apache.axiom.om.OMElement element,
java.lang.String charset,
java.lang.String contentType)
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.