public class TextFromElementDataSource
extends java.lang.Object
implements javax.activation.DataSource
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 and Description |
|---|
TextFromElementDataSource(org.apache.axiom.om.OMElement element,
java.lang.String charset,
java.lang.String contentType) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getContentType() |
java.io.InputStream |
getInputStream() |
java.lang.String |
getName() |
java.io.OutputStream |
getOutputStream() |
public TextFromElementDataSource(org.apache.axiom.om.OMElement element,
java.lang.String charset,
java.lang.String contentType)
public java.lang.String getContentType()
getContentType in interface javax.activation.DataSourcepublic java.lang.String getName()
getName in interface javax.activation.DataSourcepublic java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface javax.activation.DataSourcejava.io.IOExceptionpublic java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in interface javax.activation.DataSourcejava.io.IOExceptionCopyright © 2004-2015 The Apache Software Foundation. All Rights Reserved.