microsoft.exchange.webservices.data
Class ComplexPropertyCollection<TComplexProperty extends ComplexProperty>

java.lang.Object
  extended by microsoft.exchange.webservices.data.ComplexProperty
      extended by microsoft.exchange.webservices.data.ComplexPropertyCollection<TComplexProperty>
Type Parameters:
TComplexProperty - ComplexProperty type.
All Implemented Interfaces:
java.lang.Iterable<TComplexProperty>
Direct Known Subclasses:
AttachmentCollection, AttendeeCollection, DeletedOccurrenceInfoCollection, EmailAddressCollection, ExtendedPropertyCollection, FolderIdCollection, FolderPermissionCollection, GroupMemberCollection, InternetMessageHeaderCollection, ItemIdCollection, OccurrenceInfoCollection, RuleErrorCollection, RuleOperationErrorCollection

public abstract class ComplexPropertyCollection<TComplexProperty extends ComplexProperty>
extends ComplexProperty
implements java.lang.Iterable<TComplexProperty>

Represents a collection of properties that can be sent to and retrieved from EWS.


Constructor Summary
protected ComplexPropertyCollection()
          Initializes a new instance of.
 
Method Summary
protected  void clearChangeLog()
          Clears the change log.
 void complexPropertyChanged(ComplexProperty complexProperty)
          Complex property changed.
 boolean contains(TComplexProperty complexProperty)
          Determines whether a specific property is in the collection.
protected abstract  TComplexProperty createComplexProperty(java.lang.String xmlElementName)
          Creates the complex property.
protected  java.util.List<TComplexProperty> getAddedItems()
          Gets the added items.
protected abstract  java.lang.String getCollectionItemXmlElementName(TComplexProperty complexProperty)
          Gets the name of the collection item XML element.
 int getCount()
          * Gets the total number of properties in the collection.
protected  java.util.List<TComplexProperty> getItems()
          Gets the items.
protected  java.util.List<TComplexProperty> getModifiedItems()
          Gets the modified items.
 TComplexProperty getPropertyAtIndex(int index)
          * Gets the property at the specified index.
protected  java.util.List<TComplexProperty> getRemovedItems()
          Gets the removed items.
 int indexOf(TComplexProperty complexProperty)
          Searches for a specific property and return its zero-based index within the collection.
protected  void internalAdd(TComplexProperty complexProperty)
          Add complex property.
protected  void internalClear()
          Clear collection.
protected  boolean internalRemove(TComplexProperty complexProperty)
          Remove specified complex property.
protected  void internalRemoveAt(int index)
          Remote entry at index.
protected  void itemChanged(ComplexProperty complexProperty)
          Item changed.
 java.util.Iterator<TComplexProperty> iterator()
          Gets an enumerator that iterates through the elements of the collection.
protected  void loadFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader, java.lang.String localElementName)
          Loads from XML.
protected  void loadFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader, microsoft.exchange.webservices.data.XmlNamespace xmlNamespace, java.lang.String localElementName)
          Loads from XML.
protected  void removeFromChangeLog(TComplexProperty complexProperty)
          Removes from change log.
protected  boolean shouldWriteToXml()
          Determine whether we should write collection to XML or not.
protected  void updateFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader, microsoft.exchange.webservices.data.XmlNamespace xmlNamespace, java.lang.String xmlElementName)
          Loads from XML to update itself.
 boolean writeDeleteUpdateToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer, ServiceObject ewsObject)
          * Writes the deletion update to XML.
protected  void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          * Writes elements to XML.
 boolean writeSetUpdateToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer, ServiceObject ewsObject, PropertyDefinition propertyDefinition)
          Write set update to xml.
protected  void writeToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer, microsoft.exchange.webservices.data.XmlNamespace xmlNamespace, java.lang.String xmlElementName)
          Writes to XML.
 
Methods inherited from class microsoft.exchange.webservices.data.ComplexProperty
addOnChangeEvent, canSetFieldValue, changed, clearChangeEvents, func, getNamespace, internalValidate, readAttributesFromXml, readTextValueFromXml, removeChangeEvent, setNamespace, tryReadElementFromXml, tryReadElementFromXmlToPatch, updateFromXml, validate, writeAttributesToXml, writeToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComplexPropertyCollection

protected ComplexPropertyCollection()
Initializes a new instance of. ComplexPropertyCollection

Method Detail

createComplexProperty

protected abstract TComplexProperty createComplexProperty(java.lang.String xmlElementName)
Creates the complex property.

Parameters:
xmlElementName - Name of the XML element.
Returns:
Complex property instance.

getCollectionItemXmlElementName

protected abstract java.lang.String getCollectionItemXmlElementName(TComplexProperty complexProperty)
Gets the name of the collection item XML element.

Parameters:
complexProperty - The complex property.
Returns:
XML element name.

itemChanged

protected void itemChanged(ComplexProperty complexProperty)
Item changed.

Parameters:
complexProperty - The complex property.

loadFromXml

protected void loadFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader,
                           java.lang.String localElementName)
                    throws java.lang.Exception
Loads from XML.

Overrides:
loadFromXml in class ComplexProperty
Parameters:
reader - The reader.
localElementName - Name of the local element.
Throws:
java.lang.Exception - the exception

loadFromXml

protected void loadFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader,
                           microsoft.exchange.webservices.data.XmlNamespace xmlNamespace,
                           java.lang.String localElementName)
                    throws java.lang.Exception
Loads from XML.

Overrides:
loadFromXml in class ComplexProperty
Parameters:
reader - The reader.
xmlNamespace - The XML namespace.
localElementName - Name of the local element.
Throws:
java.lang.Exception - the exception

updateFromXml

protected void updateFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader,
                             microsoft.exchange.webservices.data.XmlNamespace xmlNamespace,
                             java.lang.String xmlElementName)
                      throws java.lang.Exception
Loads from XML to update itself.

Overrides:
updateFromXml in class ComplexProperty
Parameters:
reader - The reader.
xmlNamespace - The XML namespace.
xmlElementName - Name of the XML element.
Throws:
java.lang.Exception

writeToXml

protected void writeToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer,
                          microsoft.exchange.webservices.data.XmlNamespace xmlNamespace,
                          java.lang.String xmlElementName)
                   throws java.lang.Exception
Writes to XML.

Overrides:
writeToXml in class ComplexProperty
Parameters:
writer - The writer.
xmlNamespace - The XML namespace.
xmlElementName - Name of the XML element.
Throws:
java.lang.Exception - the exception

shouldWriteToXml

protected boolean shouldWriteToXml()
Determine whether we should write collection to XML or not.

Returns:
True if collection contains at least one element.

writeElementsToXml

protected void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                           throws java.lang.Exception
* Writes elements to XML.

Overrides:
writeElementsToXml in class ComplexProperty
Parameters:
writer - The writer.
Throws:
java.lang.Exception - the exception

clearChangeLog

protected void clearChangeLog()
Clears the change log.

Overrides:
clearChangeLog in class ComplexProperty

removeFromChangeLog

protected void removeFromChangeLog(TComplexProperty complexProperty)
Removes from change log.

Parameters:
complexProperty - The complex property.

getItems

protected java.util.List<TComplexProperty> getItems()
Gets the items.

Returns:
The items.

getAddedItems

protected java.util.List<TComplexProperty> getAddedItems()
Gets the added items.

Returns:
The added items.

getModifiedItems

protected java.util.List<TComplexProperty> getModifiedItems()
Gets the modified items.

Returns:
The modified items.

getRemovedItems

protected java.util.List<TComplexProperty> getRemovedItems()
Gets the removed items.

Returns:
The removed items.

internalAdd

protected void internalAdd(TComplexProperty complexProperty)
Add complex property.

Parameters:
complexProperty - The complex property.

complexPropertyChanged

public void complexPropertyChanged(ComplexProperty complexProperty)
Complex property changed.

Parameters:
complexProperty - accepts ComplexProperty

internalClear

protected void internalClear()
Clear collection.


internalRemoveAt

protected void internalRemoveAt(int index)
Remote entry at index.

Parameters:
index - The index.

internalRemove

protected boolean internalRemove(TComplexProperty complexProperty)
Remove specified complex property.

Parameters:
complexProperty - The complex property.
Returns:
True if the complex property was successfully removed from the collection, false otherwise.

contains

public boolean contains(TComplexProperty complexProperty)
Determines whether a specific property is in the collection.

Parameters:
complexProperty - The property to locate in the collection.
Returns:
True if the property was found in the collection, false otherwise.

indexOf

public int indexOf(TComplexProperty complexProperty)
Searches for a specific property and return its zero-based index within the collection.

Parameters:
complexProperty - The property to locate in the collection.
Returns:
The zero-based index of the property within the collection.

getCount

public int getCount()
* Gets the total number of properties in the collection.

Returns:
the count

getPropertyAtIndex

public TComplexProperty getPropertyAtIndex(int index)
                                                            throws java.lang.IllegalArgumentException
* Gets the property at the specified index.

Parameters:
index - the index
Returns:
index The property at the specified index.
Throws:
java.lang.IllegalArgumentException - thrown if if index is out of range.

iterator

public java.util.Iterator<TComplexProperty> iterator()
Gets an enumerator that iterates through the elements of the collection.

Specified by:
iterator in interface java.lang.Iterable<TComplexProperty extends ComplexProperty>
Returns:
An Iterator for the collection.

writeSetUpdateToXml

public boolean writeSetUpdateToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer,
                                   ServiceObject ewsObject,
                                   PropertyDefinition propertyDefinition)
                            throws java.lang.Exception
Write set update to xml.

Parameters:
writer - accepts EwsServiceXmlWriter
ewsObject - accepts ServiceObject
propertyDefinition - accepts PropertyDefinition
Returns:
true
Throws:
java.lang.Exception - the exception

writeDeleteUpdateToXml

public boolean writeDeleteUpdateToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer,
                                      ServiceObject ewsObject)
                               throws java.lang.Exception
* Writes the deletion update to XML.

Parameters:
writer - The writer.
ewsObject - The ews object.
Returns:
True if property generated serialization.
Throws:
java.lang.Exception - the exception