microsoft.exchange.webservices.data
Class MessageBody

java.lang.Object
  extended by microsoft.exchange.webservices.data.ComplexProperty
      extended by microsoft.exchange.webservices.data.MessageBody

public final class MessageBody
extends ComplexProperty

Represents the body of a message.


Constructor Summary
MessageBody()
          * Initializes a new instance.
MessageBody(BodyType bodyType, java.lang.String text)
          * Initializes a new instance.
MessageBody(java.lang.String text)
          * Initializes a new instance.
 
Method Summary
 BodyType getBodyType()
          Gets the type of the message body's text.
static MessageBody getMessageBodyFromText(java.lang.String textBody)
          Defines an implicit conversation between a string and MessageBody.
static java.lang.String getStringFromMessageBody(MessageBody messageBody)
          * Defines an implicit conversion of MessageBody into a string.
protected  void readAttributesFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
          * Reads attributes from XML.
protected  void readTextValueFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
          * Reads text value from XML.
 void setBodyType(BodyType bodyType)
          Sets the type of the message body's text.
 void setText(java.lang.String text)
          Sets the text of the message body.
 java.lang.String toString()
          Returns a String that represents the current Object.
protected  void writeAttributesToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          * Writes attributes to XML.
protected  void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          * Writes elements to XML.
 
Methods inherited from class microsoft.exchange.webservices.data.ComplexProperty
addOnChangeEvent, canSetFieldValue, changed, clearChangeEvents, clearChangeLog, func, getNamespace, internalValidate, loadFromXml, loadFromXml, removeChangeEvent, setNamespace, tryReadElementFromXml, tryReadElementFromXmlToPatch, updateFromXml, updateFromXml, validate, writeToXml, writeToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageBody

public MessageBody()
* Initializes a new instance.


MessageBody

public MessageBody(BodyType bodyType,
                   java.lang.String text)
* Initializes a new instance.

Parameters:
bodyType - The type of the message body's text.
text - The text of the message body.

MessageBody

public MessageBody(java.lang.String text)
* Initializes a new instance.

Parameters:
text - The text of the message body, assumed to be HTML.
Method Detail

getMessageBodyFromText

public static MessageBody getMessageBodyFromText(java.lang.String textBody)
Defines an implicit conversation between a string and MessageBody.

Parameters:
textBody - The string to convert to MessageBody, assumed to be HTML.
Returns:
A MessageBody initialized with the specified string.

getStringFromMessageBody

public static java.lang.String getStringFromMessageBody(MessageBody messageBody)
                                                 throws java.lang.Exception
* Defines an implicit conversion of MessageBody into a string.

Parameters:
messageBody - The MessageBody to convert to a string.
Returns:
A string containing the text of the MessageBody.
Throws:
java.lang.Exception - the exception

readAttributesFromXml

protected void readAttributesFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
                              throws java.lang.Exception
* Reads attributes from XML.

Overrides:
readAttributesFromXml in class ComplexProperty
Parameters:
reader - The reader.
Throws:
java.lang.Exception - the exception

readTextValueFromXml

protected void readTextValueFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
                             throws javax.xml.stream.XMLStreamException,
                                    ServiceXmlDeserializationException
* Reads text value from XML.

Overrides:
readTextValueFromXml in class ComplexProperty
Parameters:
reader - The reader.
Throws:
javax.xml.stream.XMLStreamException - the xML stream exception
ServiceXmlDeserializationException - the service xml deserialization exception

writeAttributesToXml

protected void writeAttributesToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                             throws ServiceXmlSerializationException
* Writes attributes to XML.

Overrides:
writeAttributesToXml in class ComplexProperty
Parameters:
writer - The writer.
Throws:
ServiceXmlSerializationException - the service xml serialization exception

writeElementsToXml

protected void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                           throws ServiceXmlSerializationException
* Writes elements to XML.

Overrides:
writeElementsToXml in class ComplexProperty
Parameters:
writer - The writer.
Throws:
ServiceXmlSerializationException - the service xml serialization exception

getBodyType

public BodyType getBodyType()
Gets the type of the message body's text.

Returns:
BodyType enum

setBodyType

public void setBodyType(BodyType bodyType)
Sets the type of the message body's text.

Parameters:
bodyType - BodyType enum

setText

public void setText(java.lang.String text)
Sets the text of the message body.

Parameters:
text - message body text

toString

public java.lang.String toString()
Returns a String that represents the current Object.

Overrides:
toString in class java.lang.Object
Returns:
the string