com.sap.engine.interfaces.messaging.api

Interface TextPayload

All Superinterfaces:
Payload
All Known Subinterfaces:
XMLPayload

public interface TextPayload
extends Payload

The TextPayload extends the Payload interface and specializes for the text only document.


Method Summary
 String getEncoding()
          Returns the encoding of the input stream you can get with getInputStream or the content you can get with getContent.
 Reader getReader()
          Returns a Reader to the content of this payload.
 String getText()
          Returns the content as String.
 void setContent(byte[] bytes, String encoding)
          Sets the content as byte array into payload, also specifying the encoding.
 void setText(String text)
          Sets the content as String.
 void setText(String text, String encoding)
          Sets the content as String, with the given encoding.
 
Methods inherited from interface com.sap.engine.interfaces.messaging.api.Payload
clearAttributes, getAttribute, getAttributeNames, getContent, getContentType, getDescription, getInputStream, getName, removeAttribute, setAttribute, setContent, setContentType, setDescription, setName
 

Method Detail

getEncoding

String getEncoding()
Returns the encoding of the input stream you can get with getInputStream or the content you can get with getContent.

Returns:
String text encoding.

getText

String getText()
Returns the content as String.

Returns:
String text.

setText

void setText(String text)
             throws IOException
Sets the content as String. The encoding will default to UTF-8, if not set otherwise, before.

Parameters:
text - String text content.
Throws:
IOException

setText

void setText(String text,
             String encoding)
             throws IOException
Sets the content as String, with the given encoding.

Parameters:
text - String text content.
encoding - The encoding of the given text string.
Throws:
IOException

getReader

Reader getReader()
Returns a Reader to the content of this payload.

Returns:
Reader.

setContent

void setContent(byte[] bytes,
                String encoding)
                throws InvalidParamException
Sets the content as byte array into payload, also specifying the encoding.

Parameters:
bytes - of data in byte array.
encoding - of the byte array.
Throws:
InvalidParamException - if the content or encoding is invalid.
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] SAP_XIAF [sap.com] com.sap.aii.af.ifc.facade api BC-XI


Copyright 2015 SAP AG Complete Copyright Notice