public class MessageBody extends java.lang.Object implements XMLMarshallable
Java class represents the body of a message sent via HCI sent by your client application to a connected SAP CC system;
it is a set of operations or a set of operation results.MessageEnvelope,
MessageOperation,
OperationResultThe XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="body">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
| Constructor and Description |
|---|
MessageBody()
Builds an empty message body.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(java.lang.String cData)
Adds character data to the content element.
|
void |
addChild(java.lang.String tagName,
XMLMarshallable child)
Adds a child to the objects, the
child represents
the marshallable object to be added into the content tree. |
void |
addOperation(MessageOperation op)
Adds a message operation to the message body.
|
void |
addOperationResult(OperationResult res)
Adds an operation result to the message body.
|
void |
clear()
Clears the body.
|
int |
getLength()
Returns the number of operations or operation results
contained in the body.
|
MessageOperation |
getOperation(int i)
Gets the ith operation contained in this body.
|
OperationResult |
getResult(int i)
Gets the ith operation result in this body.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, and of its
children.
|
void |
replaceLastOperationResult(OperationResult res)
Replace the last operation result in the message body.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the tag being
processed.
|
java.lang.String |
toString() |
public int getLength()
public void addOperation(MessageOperation op)
op - The operation to addpublic void addOperationResult(OperationResult res)
res - The result to addpublic void replaceLastOperationResult(OperationResult res)
res - The result to addpublic MessageOperation getOperation(int i)
i - The index of the operation to retrievejava.lang.ArrayIndexOutOfBoundsException - if i > body length.java.lang.ClassCastException - if the ith element is not a message operationpublic OperationResult getResult(int i) throws OperationFailureException
i - The index of the result to retrieveOperationFailureException - if the result is an
OperationFailureExceptionjava.lang.ArrayIndexOutOfBoundsException - if i > body lengthjava.lang.ClassCastException - if the ith element is not a resultpublic void clear()
public void setAttributes(XMLAttributes atts)
setAttributes in interface XMLMarshallableatts - The XML attributes of the current tagpublic void addChild(java.lang.String tagName,
XMLMarshallable child)
child represents
the marshallable object to be added into the content tree.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void addCharacterData(java.lang.String cData)
addCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
marshal in interface XMLMarshallableoutput - The XML output to marshal the object intopublic final java.lang.String toString()
toString in class java.lang.Object