microsoft.exchange.webservices.data
Class PropertyDefinition

java.lang.Object
  extended by microsoft.exchange.webservices.data.PropertyDefinitionBase
      extended by microsoft.exchange.webservices.data.ServiceObjectPropertyDefinition
          extended by microsoft.exchange.webservices.data.PropertyDefinition
Direct Known Subclasses:
AttachmentsPropertyDefinition, RecurrencePropertyDefinition, ResponseObjectsPropertyDefinition

public abstract class PropertyDefinition
extends ServiceObjectPropertyDefinition

Represents the definition of a folder or item property.


Constructor Summary
protected PropertyDefinition(java.lang.String xmlElementName, java.util.EnumSet<PropertyDefinitionFlags> flags, ExchangeVersion version)
          Initializes a new instance.
protected PropertyDefinition(java.lang.String xmlElementName, java.lang.String uri, java.util.EnumSet<PropertyDefinitionFlags> flags, ExchangeVersion version)
          * Initializes a new instance.
protected PropertyDefinition(java.lang.String xmlElementName, java.lang.String uri, ExchangeVersion version)
          Initializes a new instance.
 
Method Summary
protected  java.util.List<PropertyDefinition> getAssociatedInternalProperties()
          Gets a list of associated internal properties.
 java.lang.String getName()
          Gets the name of the property.
protected  java.lang.String getPrintableName()
          Gets the property definition's printable name.
 ExchangeVersion getVersion()
          Gets the minimum Exchange version that supports this property.
protected  java.lang.String getXmlElement()
          Gets the name of the XML element.
protected  boolean hasFlag(PropertyDefinitionFlags flag)
          Determines whether the specified flag is set.
protected  boolean hasFlag(PropertyDefinitionFlags flag, ExchangeVersion version)
          Determines whether the specified flag is set.
protected  boolean isNullable()
          * Gets a value indicating whether this property definition is for a nullable type.
protected abstract  void loadPropertyValueFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader, microsoft.exchange.webservices.data.PropertyBag propertyBag)
          * Loads from XML.
protected  void registerAssociatedInternalProperties(java.util.List<PropertyDefinition> properties)
          Registers associated internal properties.
protected  void setName(java.lang.String name)
          Sets the name of the property.
protected abstract  void writePropertyValueToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer, microsoft.exchange.webservices.data.PropertyBag propertyBag, boolean isUpdateOperation)
          * Writes the property value to XML.
 
Methods inherited from class microsoft.exchange.webservices.data.ServiceObjectPropertyDefinition
getUri, getXmlElementName, writeAttributesToXml
 
Methods inherited from class microsoft.exchange.webservices.data.PropertyDefinitionBase
getType, toString, tryLoadFromXml, writeToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyDefinition

protected PropertyDefinition(java.lang.String xmlElementName,
                             java.lang.String uri,
                             ExchangeVersion version)
Initializes a new instance.

Parameters:
xmlElementName - Name of the XML element.
uri - The URI.
version - The version.

PropertyDefinition

protected PropertyDefinition(java.lang.String xmlElementName,
                             java.util.EnumSet<PropertyDefinitionFlags> flags,
                             ExchangeVersion version)
Initializes a new instance.

Parameters:
xmlElementName - Name of the XML element.
flags - The flags.
version - The version.

PropertyDefinition

protected PropertyDefinition(java.lang.String xmlElementName,
                             java.lang.String uri,
                             java.util.EnumSet<PropertyDefinitionFlags> flags,
                             ExchangeVersion version)
* Initializes a new instance.

Parameters:
xmlElementName - Name of the XML element.
uri - The URI.
flags - The flags.
version - The version.
Method Detail

hasFlag

protected boolean hasFlag(PropertyDefinitionFlags flag)
Determines whether the specified flag is set.

Parameters:
flag - The flag.
Returns:
true if the specified flag is set; otherwise, false.

hasFlag

protected boolean hasFlag(PropertyDefinitionFlags flag,
                          ExchangeVersion version)
Determines whether the specified flag is set.

Parameters:
flag - The flag.
Returns:
true if the specified flag is set; otherwise, false.

registerAssociatedInternalProperties

protected void registerAssociatedInternalProperties(java.util.List<PropertyDefinition> properties)
Registers associated internal properties.

Parameters:
properties - The list in which to add the associated properties.

getAssociatedInternalProperties

protected java.util.List<PropertyDefinition> getAssociatedInternalProperties()
Gets a list of associated internal properties.

Returns:
A list of PropertyDefinition objects. This is a hack. It is here (currently) solely to help the API register the MeetingTimeZone property definition that is internal.

getVersion

public ExchangeVersion getVersion()
Gets the minimum Exchange version that supports this property.

Overrides:
getVersion in class ServiceObjectPropertyDefinition
Returns:
The version.

isNullable

protected boolean isNullable()
* Gets a value indicating whether this property definition is for a nullable type.

Returns:
always true

loadPropertyValueFromXml

protected abstract void loadPropertyValueFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader,
                                                 microsoft.exchange.webservices.data.PropertyBag propertyBag)
                                          throws ServiceXmlDeserializationException,
                                                 javax.xml.stream.XMLStreamException,
                                                 java.lang.InstantiationException,
                                                 java.lang.IllegalAccessException,
                                                 ServiceObjectPropertyException,
                                                 ServiceVersionException,
                                                 java.lang.Exception
* Loads from XML.

Parameters:
reader - The reader.
propertyBag - The property bag.
Throws:
ServiceXmlDeserializationException - the service xml deserialization exception
javax.xml.stream.XMLStreamException - the xML stream exception
java.lang.InstantiationException - the instantiation exception
java.lang.IllegalAccessException - the illegal access exception
ServiceObjectPropertyException - the service object property exception
ServiceVersionException - the service version exception
java.lang.Exception - the exception

writePropertyValueToXml

protected abstract void writePropertyValueToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer,
                                                microsoft.exchange.webservices.data.PropertyBag propertyBag,
                                                boolean isUpdateOperation)
                                         throws javax.xml.stream.XMLStreamException,
                                                ServiceXmlSerializationException,
                                                ServiceLocalException,
                                                java.lang.InstantiationException,
                                                java.lang.IllegalAccessException,
                                                ServiceValidationException,
                                                java.lang.Exception
* Writes the property value to XML.

Parameters:
writer - The writer.
propertyBag - The property bag.
isUpdateOperation - Indicates whether the context is an update operation.
Throws:
javax.xml.stream.XMLStreamException - the xML stream exception
ServiceXmlSerializationException - the service xml serialization exception
ServiceLocalException - the service local exception
java.lang.InstantiationException - the instantiation exception
java.lang.IllegalAccessException - the illegal access exception
ServiceValidationException - the service validation exception
java.lang.Exception - the exception

getXmlElement

protected java.lang.String getXmlElement()
Gets the name of the XML element.

Returns:
The name of the XML element.

getName

public java.lang.String getName()
Gets the name of the property.

Returns:
Name of the property.

setName

protected void setName(java.lang.String name)
Sets the name of the property.

Parameters:
name - name of the property

getPrintableName

protected java.lang.String getPrintableName()
Gets the property definition's printable name.

Specified by:
getPrintableName in class PropertyDefinitionBase
Returns:
The property definition's printable name.