Class TextFromElementDataSource

java.lang.Object
org.apache.axis2.format.TextFromElementDataSource
All Implemented Interfaces:
jakarta.activation.DataSource

public class TextFromElementDataSource extends Object implements jakarta.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 Details

    • TextFromElementDataSource

      public TextFromElementDataSource(org.apache.axiom.om.OMElement element, String charset, String contentType)
  • Method Details

    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface jakarta.activation.DataSource
    • getName

      public String getName()
      Specified by:
      getName in interface jakarta.activation.DataSource
    • getInputStream

      public InputStream getInputStream() throws IOException
      Specified by:
      getInputStream in interface jakarta.activation.DataSource
      Throws:
      IOException
    • getOutputStream

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