當前位置: 首頁>>代碼示例>>Java>>正文


Java BodyType類代碼示例

本文整理匯總了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();
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:32,代碼來源:ExchangeService.java

示例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---");
  }
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:21,代碼來源:MessageBody.java

示例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());
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:13,代碼來源:MessageBody.java

示例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();
  }
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:12,代碼來源:MessageBody.java

示例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
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:48,代碼來源:PropertySet.java

示例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);

}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:20,代碼來源:ExchangeService.java

示例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();
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:42,代碼來源:GetAttachmentRequest.java

示例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());
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:6,代碼來源:UniqueBodyTest.java

示例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());
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:5,代碼來源:UniqueBodyTest.java

示例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);
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:14,代碼來源:Attachment.java

示例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);
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:17,代碼來源:ExchangeService.java

示例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;
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:12,代碼來源:MessageBody.java

示例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);
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:10,代碼來源:MessageBody.java

示例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);
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:12,代碼來源:MessageBody.java

示例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;
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:9,代碼來源:MessageBody.java


注:本文中的microsoft.exchange.webservices.data.core.enumeration.property.BodyType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。