Class MessageBody
- java.lang.Object
-
- microsoft.exchange.webservices.data.property.complex.ComplexProperty
-
- 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
Constructors Constructor Description MessageBody()Initializes a new instance.MessageBody(String text)Initializes a new instance.MessageBody(BodyType bodyType, String text)Initializes a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BodyTypegetBodyType()Gets the type of the message body's text.static MessageBodygetMessageBodyFromText(String textBody)Defines an implicit conversation between a string and MessageBody.static StringgetStringFromMessageBody(MessageBody messageBody)Defines an implicit conversion of MessageBody into a string.voidreadAttributesFromXml(EwsServiceXmlReader reader)Reads attribute from XML.voidreadTextValueFromXml(EwsServiceXmlReader reader)Reads text value from XML.voidsetBodyType(BodyType bodyType)Sets the type of the message body's text.voidsetText(String text)Sets the text of the message body.StringtoString()Returns a String that represents the current Object.voidwriteAttributesToXml(EwsServiceXmlWriter writer)Writes attribute to XML.voidwriteElementsToXml(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
-
-
-
-
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:
readAttributesFromXmlin classComplexProperty- Parameters:
reader- The reader.- Throws:
Exception- the exception
-
readTextValueFromXml
public void readTextValueFromXml(EwsServiceXmlReader reader) throws XMLStreamException, ServiceXmlDeserializationException
Reads text value from XML.- Overrides:
readTextValueFromXmlin classComplexProperty- Parameters:
reader- the reader- Throws:
XMLStreamException- the XML stream exceptionServiceXmlDeserializationException- the service xml deserialization exception
-
writeAttributesToXml
public void writeAttributesToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException
Writes attribute to XML.- Overrides:
writeAttributesToXmlin classComplexProperty- Parameters:
writer- The writer.- Throws:
ServiceXmlSerializationException- the service xml serialization exception
-
writeElementsToXml
public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException
Writes elements to XML.- Overrides:
writeElementsToXmlin classComplexProperty- 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
-
-