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

java.lang.Object
  extended by microsoft.exchange.webservices.data.property.complex.ComplexProperty
      extended by microsoft.exchange.webservices.data.property.complex.ComplexPropertyCollection<TComplexProperty>
Type Parameters:
TComplexProperty - ComplexProperty type.
All Implemented Interfaces:
Iterable<TComplexProperty>, ICustomXmlUpdateSerializer, ISelfValidate, ComplexFunctionDelegate<EwsServiceXmlReader>, IComplexPropertyChangedDelegate<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 ICustomXmlUpdateSerializer, Iterable<TComplexProperty>, IComplexPropertyChangedDelegate<TComplexProperty>

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


Constructor Summary
protected ComplexPropertyCollection()
          Initializes a new instance of.
 
Method Summary
 void clearChangeLog()
          Clears the change log.
 void complexPropertyChanged(TComplexProperty complexProperty)
          Complex property changed.
 boolean contains(TComplexProperty complexProperty)
          Determines whether a specific property is in the collection.
protected abstract  TComplexProperty createComplexProperty(String xmlElementName)
          Creates the complex property.
protected  List<TComplexProperty> getAddedItems()
          Gets the added item.
protected abstract  String getCollectionItemXmlElementName(TComplexProperty complexProperty)
          Gets the name of the collection item XML element.
 int getCount()
          Gets the total number of property in the collection.
 List<TComplexProperty> getItems()
          Gets the item.
protected  List<TComplexProperty> getModifiedItems()
          Gets the modified item.
 TComplexProperty getPropertyAtIndex(int index)
          Gets the property at the specified index.
protected  List<TComplexProperty> getRemovedItems()
          Gets the removed item.
 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(TComplexProperty property)
          Item changed.
 Iterator<TComplexProperty> iterator()
          Gets an enumerator that iterates through the elements of the collection.
 void loadFromXml(EwsServiceXmlReader reader, String localElementName)
          Loads from XML.
 void loadFromXml(EwsServiceXmlReader reader, XmlNamespace xmlNamespace, String localElementName)
          Loads from XML.
protected  void removeFromChangeLog(TComplexProperty complexProperty)
          Removes from change log.
 boolean shouldWriteToXml()
          Determine whether we should write collection to XML or not.
 void updateFromXml(EwsServiceXmlReader reader, XmlNamespace xmlNamespace, String xmlElementName)
          Loads from XML to update itself.
 boolean writeDeleteUpdateToXml(EwsServiceXmlWriter writer, ServiceObject ewsObject)
          Writes the deletion update to XML.
 void writeElementsToXml(EwsServiceXmlWriter writer)
          Writes elements to XML.
 boolean writeSetUpdateToXml(EwsServiceXmlWriter writer, ServiceObject ewsObject, PropertyDefinition propertyDefinition)
          Write set update to xml.
 void writeToXml(EwsServiceXmlWriter writer, XmlNamespace xmlNamespace, String xmlElementName)
          Writes to XML.
 
Methods inherited from class microsoft.exchange.webservices.data.property.complex.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(String xmlElementName)
Creates the complex property.

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

getCollectionItemXmlElementName

protected abstract 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(TComplexProperty property)
Item changed.

Parameters:
property - The complex property.

loadFromXml

public void loadFromXml(EwsServiceXmlReader reader,
                        String localElementName)
                 throws Exception
Loads from XML.

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

loadFromXml

public void loadFromXml(EwsServiceXmlReader reader,
                        XmlNamespace xmlNamespace,
                        String localElementName)
                 throws Exception
Loads from XML.

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

updateFromXml

public void updateFromXml(EwsServiceXmlReader reader,
                          XmlNamespace xmlNamespace,
                          String xmlElementName)
                   throws 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:
Exception

writeToXml

public void writeToXml(EwsServiceXmlWriter writer,
                       XmlNamespace xmlNamespace,
                       String xmlElementName)
                throws Exception
Writes to XML.

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

shouldWriteToXml

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

Returns:
True if collection contains at least one element.

writeElementsToXml

public void writeElementsToXml(EwsServiceXmlWriter writer)
                        throws Exception
Writes elements to XML.

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

clearChangeLog

public 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

public List<TComplexProperty> getItems()
Gets the item.

Returns:
The item.

getAddedItems

protected List<TComplexProperty> getAddedItems()
Gets the added item.

Returns:
The added item.

getModifiedItems

protected List<TComplexProperty> getModifiedItems()
Gets the modified item.

Returns:
The modified item.

getRemovedItems

protected List<TComplexProperty> getRemovedItems()
Gets the removed item.

Returns:
The removed item.

internalAdd

protected void internalAdd(TComplexProperty complexProperty)
Add complex property.

Parameters:
complexProperty - The complex property.

complexPropertyChanged

public void complexPropertyChanged(TComplexProperty complexProperty)
Complex property changed.

Specified by:
complexPropertyChanged in interface IComplexPropertyChangedDelegate<TComplexProperty extends ComplexProperty>
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 property in the collection.

Returns:
the count

getPropertyAtIndex

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

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

iterator

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

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

writeSetUpdateToXml

public boolean writeSetUpdateToXml(EwsServiceXmlWriter writer,
                                   ServiceObject ewsObject,
                                   PropertyDefinition propertyDefinition)
                            throws Exception
Write set update to xml.

Specified by:
writeSetUpdateToXml in interface ICustomXmlUpdateSerializer
Parameters:
writer - accepts EwsServiceXmlWriter
ewsObject - accepts ServiceObject
propertyDefinition - accepts PropertyDefinition
Returns:
true
Throws:
Exception - the exception

writeDeleteUpdateToXml

public boolean writeDeleteUpdateToXml(EwsServiceXmlWriter writer,
                                      ServiceObject ewsObject)
                               throws Exception
Writes the deletion update to XML.

Specified by:
writeDeleteUpdateToXml in interface ICustomXmlUpdateSerializer
Parameters:
writer - The writer.
ewsObject - The ews object.
Returns:
True if property generated serialization.
Throws:
Exception - the exception


Copyright © 2012–2015 Microsoft. All rights reserved.