/** * Writes elements to XML. * * @param writer The writer. * @throws ServiceXmlSerializationException the service xml serialization exception */ public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { writer.writeValue(this.phoneNumber, XmlElementNames.PhoneNumber); }
/** * Writes elements to XML. * * @param writer The writer. * @throws ServiceXmlSerializationException the service xml serialization exception */ public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { writer.writeValue(this.imAddress, XmlElementNames.ImAddress); } }
/** * Writes elements to XML. * * @param writer the writer * @throws ServiceXmlSerializationException the service xml serialization exception */ public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { writer.writeValue(this.value, this.name); }
/** * Writes elements to XML. * * @param writer the writer * @throws ServiceXmlSerializationException the service xml serialization exception */ public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { if (!(this.text == null || this.text.isEmpty())) { writer.writeValue(this.text, XmlElementNames.UniqueBody); } }
/** * Writes elements to XML. * * @param writer The writer. * @throws ServiceXmlSerializationException the service xml serialization exception */ @Override public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { if (null != this.text && !this.text.isEmpty()) { writer.writeValue(this.getText(), XmlElementNames.Body); } }
/** * Writes elements to XML. * * @param writer accepts EwsServiceXmlWriter * @throws ServiceXmlSerializationException throws ServiceXmlSerializationException */ @Override public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { writer.writeValue(this.getEmailAddress().getAddress(), XmlElementNames.EmailAddress); }
/** * Writes elements to XML. * * @param writer accepts EwsServiceXmlWriter * @throws ServiceXmlSerializationException the service xml serialization exception * @throws XMLStreamException the XML stream exception */ @Override public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException, XMLStreamException { for (String item : this.items) { writer.writeStartElement(XmlNamespace.Types, this.itemXmlElementName); writer.writeValue(item, this.itemXmlElementName); writer.writeEndElement(); } }
/** * Writes a dictionary entry value to Xml. * * @param writer the writer * @param value value to write * @throws XMLStreamException the XML stream exception * @throws ServiceXmlSerializationException the service xml serialization exception */ private void writeEntryValueToXml(EwsServiceXmlWriter writer, String value) throws XMLStreamException, ServiceXmlSerializationException { writer.writeStartElement(XmlNamespace.Types, XmlElementNames.Value); // While an entry value can't be null, if the entry is an array, an // element of the array can be null. if (value != null) { writer.writeValue(value, XmlElementNames.Value); } writer.writeEndElement(); }
/** * Writes a dictionary entry type to Xml. * * @param writer the writer * @param dictionaryObjectType type to write * @throws XMLStreamException the XML stream exception * @throws ServiceXmlSerializationException the service xml serialization exception */ private void writeEntryTypeToXml(EwsServiceXmlWriter writer, UserConfigurationDictionaryObjectType dictionaryObjectType) throws XMLStreamException, ServiceXmlSerializationException { writer.writeStartElement(XmlNamespace.Types, XmlElementNames.Type); writer .writeValue(dictionaryObjectType.toString(), XmlElementNames.Type); writer.writeEndElement(); }
/** * Writes elements to XML. * * @param writer the writer * @throws ServiceXmlSerializationException the service xml serialization exception * @throws XMLStreamException the XML stream exception */ @Override public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException, XMLStreamException { writer.writeStartElement(XmlNamespace.Types, XmlElementNames.To); if (this.targetPeriod != null) { writer.writeAttributeValue(XmlAttributeNames.Kind, PeriodTarget); writer.writeValue(this.targetPeriod.getId(), XmlElementNames.To); } else if (this.targetGroup != null) { writer.writeAttributeValue(XmlAttributeNames.Kind, GroupTarget); writer.writeValue(this.targetGroup.getId(), XmlElementNames.To); } writer.writeEndElement(); // To }
/** * Writes a byte array to Xml. * * @param writer the writer * @param byteArray byte array to write * @param xmlElementName name of the Xml element * @throws XMLStreamException the XML stream exception * @throws ServiceXmlSerializationException the service xml serialization exception */ private static void writeByteArrayToXml(EwsServiceXmlWriter writer, byte[] byteArray, String xmlElementName) throws XMLStreamException, ServiceXmlSerializationException { EwsUtilities.ewsAssert(writer != null, "UserConfiguration.WriteByteArrayToXml", "writer is null"); EwsUtilities.ewsAssert(xmlElementName != null, "UserConfiguration.WriteByteArrayToXml", "xmlElementName is null"); writer.writeStartElement(XmlNamespace.Types, xmlElementName); if (byteArray != null && byteArray.length > 0) { writer.writeValue(Base64.encodeBase64String(byteArray), xmlElementName); } writer.writeEndElement(); }
/** * Writes the element value. * * @param xmlNamespace the XML namespace * @param localName the local name of the element * @param displayName the name that should appear in the exception message when the value can not be serialized * @param value the value * @throws XMLStreamException the XML stream exception * @throws ServiceXmlSerializationException the service xml serialization exception */ public void writeElementValue(XmlNamespace xmlNamespace, String localName, String displayName, Object value) throws XMLStreamException, ServiceXmlSerializationException { String stringValue = null; OutParam<String> strOut = new OutParam<String>(); if (this.tryConvertObjectToString(value, strOut)) { stringValue = strOut.getParam(); if (null != stringValue) { // allow an empty string to create an empty element (like <Value // />). this.writeStartElement(xmlNamespace, localName); this.writeValue(stringValue, displayName); this.writeEndElement(); } } else { throw new ServiceXmlSerializationException(String.format( "Values of type '%s' can't be used for the '%s' element.", value.getClass() .getName(), localName)); } }
/** * Writes the property value to XML. * * @param writer accepts EwsServiceXmlWriter * @param propertyBag accepts PropertyBag * @param isUpdateOperation accepts boolean whether the context is an update operation. * @throws Exception throws Exception */ public void writePropertyValueToXml(EwsServiceXmlWriter writer, PropertyBag propertyBag, boolean isUpdateOperation) throws Exception { Object value = propertyBag.getObjectFromPropertyDefinition(this); if (value != null) { writer.writeStartElement(XmlNamespace.Types, getXmlElement()); // No need of changing the date time zone to UTC as Java takes // default timezone as UTC Date dateTime = (Date) value; writer.writeValue(EwsUtilities.dateTimeToXSDateTime(dateTime), getName()); writer.writeEndElement(); } }
/** * Writes elements to XML. * * @param writer The writer. * @throws ServiceXmlSerializationException the service xml serialization exception */ public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { writer.writeValue(this.phoneNumber, XmlElementNames.PhoneNumber); }
/** * Writes elements to XML. * * @param writer the writer * @throws ServiceXmlSerializationException the service xml serialization exception */ public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { writer.writeValue(this.value, this.name); }
/** * Writes elements to XML. * * @param writer The writer. * @throws ServiceXmlSerializationException the service xml serialization exception */ public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { writer.writeValue(this.imAddress, XmlElementNames.ImAddress); } }
/** * Writes elements to XML. * * @param writer the writer * @throws ServiceXmlSerializationException the service xml serialization exception */ public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { if (!(this.text == null || this.text.isEmpty())) { writer.writeValue(this.text, XmlElementNames.UniqueBody); } }
/** * Writes elements to XML. * * @param writer The writer. * @throws ServiceXmlSerializationException the service xml serialization exception */ @Override public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { if (null != this.text && !this.text.isEmpty()) { writer.writeValue(this.getText(), XmlElementNames.Body); } }
/** * Writes elements to XML. * * @param writer accepts EwsServiceXmlWriter * @throws ServiceXmlSerializationException throws ServiceXmlSerializationException */ @Override public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { writer.writeValue(this.getEmailAddress().getAddress(), XmlElementNames.EmailAddress); }
/** * Writes elements to XML. * * @param writer accepts EwsServiceXmlWriter * @throws ServiceXmlSerializationException the service xml serialization exception * @throws XMLStreamException the XML stream exception */ @Override public void writeElementsToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException, XMLStreamException { for (String item : this.items) { writer.writeStartElement(XmlNamespace.Types, this.itemXmlElementName); writer.writeValue(item, this.itemXmlElementName); writer.writeEndElement(); } }