microsoft.exchange.webservices.data.property.complex
Class MessageBody

java.lang.Object
  extended by microsoft.exchange.webservices.data.property.complex.ComplexProperty
      extended by microsoft.exchange.webservices.data.property.complex.MessageBody
All Implemented Interfaces:
ISelfValidate, ComplexFunctionDelegate<EwsServiceXmlReader>

public final class MessageBody
extends ComplexProperty

Represents the body of a message.


Constructor Summary
MessageBody()
          Initializes a new instance.
MessageBody(BodyType bodyType, String text)
          Initializes a new instance.
MessageBody(String text)
          Initializes a new instance.
 
Method Summary
 BodyType getBodyType()
          Gets the type of the message body's text.
static MessageBody getMessageBodyFromText(String textBody)
          Defines an implicit conversation between a string and MessageBody.
static String getStringFromMessageBody(MessageBody messageBody)
          Defines an implicit conversion of MessageBody into a string.
 void readAttributesFromXml(EwsServiceXmlReader reader)
          Reads attribute from XML.
 void readTextValueFromXml(EwsServiceXmlReader reader)
          Reads text value from XML.
 void setBodyType(BodyType bodyType)
          Sets the type of the message body's text.
 void setText(String text)
          Sets the text of the message body.
 String toString()
          Returns a String that represents the current Object.
 void writeAttributesToXml(EwsServiceXmlWriter writer)
          Writes attribute to XML.
 void writeElementsToXml(EwsServiceXmlWriter writer)
          Writes elements to XML.
 
Methods inherited from class microsoft.exchange.webservices.data.property.complex.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,
                   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(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(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 String getStringFromMessageBody(MessageBody messageBody)
                                       throws 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:
Exception - the exception

readAttributesFromXml

public void readAttributesFromXml(EwsServiceXmlReader reader)
                           throws Exception
Reads attribute from XML.

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

readTextValueFromXml

public void readTextValueFromXml(EwsServiceXmlReader reader)
                          throws XMLStreamException,
                                 ServiceXmlDeserializationException
Reads text value from XML.

Overrides:
readTextValueFromXml in class ComplexProperty
Parameters:
reader - the reader
Throws:
XMLStreamException - the XML stream exception
ServiceXmlDeserializationException - the service xml deserialization exception

writeAttributesToXml

public void writeAttributesToXml(EwsServiceXmlWriter writer)
                          throws ServiceXmlSerializationException
Writes attribute to XML.

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

writeElementsToXml

public void writeElementsToXml(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(String text)
Sets the text of the message body.

Parameters:
text - message body text

toString

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

Overrides:
toString in class Object
Returns:
the string


Copyright © 2012–2015 Microsoft. All rights reserved.