Package org.apache.axis2.format
Class TextFromElementDataSource
- java.lang.Object
-
- org.apache.axis2.format.TextFromElementDataSource
-
- All Implemented Interfaces:
DataSource
public class TextFromElementDataSource extends Object implements DataSource
Data source that represents the text of a givenOMElement
.The expression
new TextFromElementDataSource(element, charset, contentType)
produces a DataSource implementation that is equivalent tonew ByteArrayDataSource(element.getText().getBytes(charset), contentType)
but that is more efficient.
-
-
Constructor Summary
Constructors Constructor Description TextFromElementDataSource(OMElement element, String charset, String contentType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getContentType()
InputStream
getInputStream()
String
getName()
OutputStream
getOutputStream()
-
-
-
Method Detail
-
getContentType
public String getContentType()
- Specified by:
getContentType
in interfaceDataSource
-
getName
public String getName()
- Specified by:
getName
in interfaceDataSource
-
getInputStream
public InputStream getInputStream() throws IOException
- Specified by:
getInputStream
in interfaceDataSource
- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream() throws IOException
- Specified by:
getOutputStream
in interfaceDataSource
- Throws:
IOException
-
-