本文整理汇总了Java中microsoft.exchange.webservices.data.core.enumeration.property.BodyType类的典型用法代码示例。如果您正苦于以下问题:Java BodyType类的具体用法?Java BodyType怎么用?Java BodyType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BodyType类属于microsoft.exchange.webservices.data.core.enumeration.property包,在下文中一共展示了BodyType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: internalGetAttachments
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
/**
* Gets an attachment.
*
* @param attachments the attachments
* @param bodyType the body type
* @param additionalProperties the additional property
* @param errorHandling the error handling
* @throws Exception the exception
*/
private ServiceResponseCollection<GetAttachmentResponse> internalGetAttachments(
Iterable<Attachment> attachments, BodyType bodyType,
Iterable<PropertyDefinitionBase> additionalProperties, ServiceErrorHandling errorHandling)
throws Exception {
GetAttachmentRequest request = new GetAttachmentRequest(this, errorHandling);
Iterator<Attachment> it = attachments.iterator();
while (it.hasNext()) {
request.getAttachments().add(it.next());
}
request.setBodyType(bodyType);
if (additionalProperties != null) {
List<PropertyDefinitionBase> propsArray = new ArrayList<PropertyDefinitionBase>();
for (PropertyDefinitionBase propertyDefinitionBase : additionalProperties) {
propsArray.add(propertyDefinitionBase);
}
request.getAdditionalProperties().addAll(propsArray);
}
return request.execute();
}
示例2: readTextValueFromXml
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
/**
* Reads text value from XML.
*
* @param reader the reader
* @throws XMLStreamException the XML stream exception
* @throws ServiceXmlDeserializationException the service xml deserialization exception
*/
@Override
public void readTextValueFromXml(EwsServiceXmlReader reader)
throws XMLStreamException, ServiceXmlDeserializationException {
if (log.isDebugEnabled()) {
log.debug("Reading text value from XML. BodyType = " + this.getBodyType() +
", keepWhiteSpace = " +
((this.getBodyType() == BodyType.Text) ? "true." : "false."));
}
this.text = reader.readValue(this.getBodyType() == BodyType.Text);
if (log.isDebugEnabled()) {
log.debug("Text value read:\n---\n" + this.text + "\n---");
}
}
示例3: writeAttributesToXml
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
/**
* Writes attribute to XML.
*
* @param writer The writer.
* @throws ServiceXmlSerializationException the service xml serialization exception
*/
@Override
public void writeAttributesToXml(EwsServiceXmlWriter writer)
throws ServiceXmlSerializationException {
writer.writeAttributeValue(XmlAttributeNames.BodyType, this
.getBodyType());
}
示例4: setBodyType
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
/**
* Sets the type of the message body's text.
*
* @param bodyType BodyType enum
*/
public void setBodyType(BodyType bodyType) {
if (this.canSetFieldValue(this.bodyType, bodyType)) {
this.bodyType = bodyType;
this.changed();
}
}
示例5: writeToXml
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
/**
* Writes the property set to XML.
*
* @param writer The writer to write to
* @param serviceObjectType The type of service object the property set is emitted for
* @throws XMLStreamException the XML stream exception
* @throws ServiceXmlSerializationException the service xml serialization exception
*/
public void writeToXml(EwsServiceXmlWriter writer, ServiceObjectType serviceObjectType) throws XMLStreamException, ServiceXmlSerializationException {
writer
.writeStartElement(
XmlNamespace.Messages,
serviceObjectType == ServiceObjectType.Item ?
XmlElementNames.ItemShape
: XmlElementNames.FolderShape);
writer.writeElementValue(XmlNamespace.Types, XmlElementNames.BaseShape,
this.getBasePropertySet().getBaseShapeValue());
if (serviceObjectType == ServiceObjectType.Item) {
if (this.getRequestedBodyType() != null) {
writer.writeElementValue(XmlNamespace.Types,
XmlElementNames.BodyType, this.getRequestedBodyType());
}
if (this.getFilterHtmlContent() != null) {
writer.writeElementValue(XmlNamespace.Types,
XmlElementNames.FilterHtmlContent, this
.getFilterHtmlContent());
}
if ((this.getConvertHtmlCodePageToUTF8() != null) &&
writer.getService().getRequestedServerVersion().
compareTo(ExchangeVersion.Exchange2010_SP1) >= 0) {
writer.writeElementValue(
XmlNamespace.Types,
XmlElementNames.ConvertHtmlCodePageToUTF8,
this.getConvertHtmlCodePageToUTF8());
}
}
if (this.additionalProperties.size() > 0) {
writeAdditionalPropertiesToXml(writer, this.additionalProperties
.iterator());
}
writer.writeEndElement(); // Item/FolderShape
}
示例6: getAttachment
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
/**
* Gets the attachment.
*
* @param attachment the attachment
* @param bodyType the body type
* @param additionalProperties the additional property
* @throws Exception the exception
*/
public void getAttachment(Attachment attachment, BodyType bodyType,
Iterable<PropertyDefinitionBase> additionalProperties)
throws Exception {
List<Attachment> attachmentArray = new ArrayList<Attachment>();
attachmentArray.add(attachment);
this.internalGetAttachments(attachmentArray, bodyType, additionalProperties,
ServiceErrorHandling.ThrowOnError);
}
示例7: writeElementsToXml
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
/**
* Writes XML elements.
*
* @param writer the writer
* @throws XMLStreamException the XML stream exception
* @throws ServiceXmlSerializationException the service xml serialization exception
*/
@Override
protected void writeElementsToXml(EwsServiceXmlWriter writer)
throws XMLStreamException, ServiceXmlSerializationException {
if ((this.getBodyType() != null)
|| this.getAdditionalProperties().size() > 0) {
writer.writeStartElement(XmlNamespace.Messages,
XmlElementNames.AttachmentShape);
if (this.getBodyType() != null) {
writer.writeElementValue(XmlNamespace.Types,
XmlElementNames.BodyType, this.getBodyType());
}
if (this.getAdditionalProperties().size() > 0) {
PropertySet.writeAdditionalPropertiesToXml(writer, this.getAdditionalProperties().iterator());
}
writer.writeEndElement(); // AttachmentShape
}
writer.writeStartElement(XmlNamespace.Messages,
XmlElementNames.AttachmentIds);
for (Attachment attachment : this.getAttachments()) {
writer.writeStartElement(XmlNamespace.Types,
XmlElementNames.AttachmentId);
writer
.writeAttributeValue(XmlAttributeNames.Id, attachment
.getId());
writer.writeEndElement();
}
writer.writeEndElement();
}
示例8: testReadAttributesFromXml
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
@Test public void testReadAttributesFromXml() throws Exception {
doReturn(BodyType.Text).when(reader).readAttributeValue(BodyType.class, XmlAttributeNames.BodyType);
impl.readAttributesFromXml(reader);
assertEquals(BodyType.Text, impl.getBodyType());
}
示例9: testWriteAttributesToXml
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
@Test public void testWriteAttributesToXml() throws Exception {
impl.writeAttributesToXml(writer);
verify(writer).writeAttributeValue(XmlAttributeNames.BodyType, impl.getBodyType());
}
示例10: internalLoad
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
/**
* Load the attachment.
*
* @param bodyType Type of the body.
* @param additionalProperties The additional property.
* @throws Exception the exception
*/
protected void internalLoad(BodyType bodyType,
Iterable<PropertyDefinitionBase> additionalProperties)
throws Exception {
this.getOwner().getService().getAttachment(this, bodyType,
additionalProperties);
}
示例11: getAttachments
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
/**
* Gets attachments.
*
* @param attachments the attachments
* @param bodyType the body type
* @param additionalProperties the additional property
* @return service response collection
* @throws Exception on error
*/
protected ServiceResponseCollection<GetAttachmentResponse> getAttachments(
Attachment[] attachments, BodyType bodyType,
Iterable<PropertyDefinitionBase> additionalProperties)
throws Exception {
return this.internalGetAttachments(Arrays.asList(attachments), bodyType,
additionalProperties, ServiceErrorHandling.ReturnErrors);
}
示例12: MessageBody
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
/**
* Initializes a new instance.
*
* @param bodyType The type of the message body's text.
* @param text The text of the message body.
*/
public MessageBody(BodyType bodyType, String text) {
this();
this.bodyType = bodyType;
this.text = text;
}
示例13: getMessageBodyFromText
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
/**
* Defines an implicit conversation between a string and MessageBody.
*
* @param textBody The string to convert to MessageBody, assumed to be HTML.
* @return A MessageBody initialized with the specified string.
*/
public static MessageBody getMessageBodyFromText(String textBody) {
return new MessageBody(BodyType.HTML, textBody);
}
示例14: readAttributesFromXml
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
/**
* Reads attribute from XML.
*
* @param reader The reader.
* @throws Exception the exception
*/
public void readAttributesFromXml(EwsServiceXmlReader reader)
throws Exception {
this.bodyType = reader.readAttributeValue(BodyType.class,
XmlAttributeNames.BodyType);
}
示例15: getBodyType
import microsoft.exchange.webservices.data.core.enumeration.property.BodyType; //导入依赖的package包/类
/**
* Gets the type of the message body's text.
*
* @return BodyType enum
*/
public BodyType getBodyType() {
return this.bodyType;
}