microsoft.exchange.webservices.data
Class PropertySet

java.lang.Object
  extended by microsoft.exchange.webservices.data.PropertySet
All Implemented Interfaces:
java.lang.Iterable<PropertyDefinitionBase>

public final class PropertySet
extends java.lang.Object
implements java.lang.Iterable<PropertyDefinitionBase>

Represents a set of item or folder properties. Property sets are used to indicate what properties of an item or folder should be loaded when binding to an existing item or folder or when loading an item or folder's properties.


Field Summary
static PropertySet FirstClassProperties
          The Constant FirstClassProperties.
static PropertySet IdOnly
          The Constant IdOnly.
 
Constructor Summary
PropertySet()
          Initializes a new instance of PropertySet based upon BasePropertySet.IdOnly.
PropertySet(BasePropertySet basePropertySet)
          Initializes a new instance of PropertySet.
PropertySet(BasePropertySet basePropertySet, java.util.Iterator<PropertyDefinitionBase> additionalProperties)
          Initializes a new instance of PropertySet.
PropertySet(BasePropertySet basePropertySet, PropertyDefinitionBase... additionalProperties)
          Initializes a new instance of PropertySet.
PropertySet(java.util.Iterator<PropertyDefinitionBase> additionalProperties)
          Initializes a new instance of PropertySet based upon BasePropertySet.IdOnly.
PropertySet(PropertyDefinitionBase... additionalProperties)
          Initializes a new instance of PropertySet based upon BasePropertySet.IdOnly.
 
Method Summary
 void add(PropertyDefinitionBase property)
          * Adds the specified property to the property set.
 void addRange(java.lang.Iterable<PropertyDefinitionBase> properties)
          * Adds the specified properties to the property set.
 void clear()
          Remove all explicitly added properties from the property set.
 boolean contains(PropertyDefinitionBase property)
          Determines whether the specified property has been explicitly added to this property set using the Add or AddRange methods.
 BasePropertySet getBasePropertySet()
          * Gets the base property set, the property set is based upon.
 java.lang.Boolean getConvertHtmlCodePageToUTF8()
          Gets value indicating whether or not to convert HTML code page to UTF8 encoding.
 int getCount()
          * Gets the number of explicitly added properties in this set.
static microsoft.exchange.webservices.data.LazyMember<java.util.Map<BasePropertySet,java.lang.String>> getDefaultPropertySetMap()
          *Maps BasePropertySet values to EWS's BaseShape values.
 java.lang.Boolean getFilterHtmlContent()
          * Gets value indicating whether or not to filter potentially unsafe HTML content from message bodies.
static PropertySet getFirstClassProperties()
          Returns a predefined property set that includes the first class properties of an item or folder.
 PropertyDefinitionBase getPropertyDefinitionBaseAt(int index)
          * Gets the PropertyDefinitionBase at the specified index.
static PropertySet getPropertySetFromBasePropertySet(BasePropertySet basePropertySet)
          Implements an implicit conversion between PropertySet and BasePropertySet.
 BodyType getRequestedBodyType()
          * Gets type of body that should be loaded on items.
protected  void internalValidate()
          * Validates this property set.
 java.util.Iterator<PropertyDefinitionBase> iterator()
           
 boolean remove(PropertyDefinitionBase property)
          Removes the specified property from the set.
 void setBasePropertySet(BasePropertySet basePropertySet)
          Sets the base property set, the property set is based upon.
 void setConvertHtmlCodePageToUTF8(java.lang.Boolean value)
          Sets value indicating whether or not to convert HTML code page to UTF8 encoding.
 void setFilterHtmlContent(java.lang.Boolean filterHtml)
          Sets value indicating whether or not to filter potentially unsafe HTML content from message bodies.
 void setRequestedBodyType(BodyType requestedBodyType)
          Sets type of body that should be loaded on items.
 void validate()
          Validate.
protected  void validateForRequest(microsoft.exchange.webservices.data.ServiceRequestBase request, boolean summaryPropertiesOnly)
          * Validates this property set instance for request to ensure that: 1.
protected static void writeAdditionalPropertiesToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer, java.util.Iterator<PropertyDefinitionBase> propertyDefinitions)
          * Writes additonal properties to XML.
protected  void writeToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer, ServiceObjectType serviceObjectType)
          * Writes the property set to XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IdOnly

public static final PropertySet IdOnly
The Constant IdOnly.


FirstClassProperties

public static final PropertySet FirstClassProperties
The Constant FirstClassProperties.

Constructor Detail

PropertySet

public PropertySet(BasePropertySet basePropertySet,
                   PropertyDefinitionBase... additionalProperties)
Initializes a new instance of PropertySet.

Parameters:
basePropertySet - The base property set to base the property set upon.
additionalProperties - Additional properties to include in the property set. Property definitions are available as static members from schema classes (for example, EmailMessageSchema.Subject, AppointmentSchema.Start, ContactSchema.GivenName, etc.)

PropertySet

public PropertySet(BasePropertySet basePropertySet,
                   java.util.Iterator<PropertyDefinitionBase> additionalProperties)
Initializes a new instance of PropertySet.

Parameters:
basePropertySet - The base property set to base the property set upon.
additionalProperties - Additional properties to include in the property set. Property definitions are available as static members from schema classes (for example, EmailMessageSchema.Subject, AppointmentSchema.Start, ContactSchema.GivenName, etc.)

PropertySet

public PropertySet()
Initializes a new instance of PropertySet based upon BasePropertySet.IdOnly.


PropertySet

public PropertySet(BasePropertySet basePropertySet)
Initializes a new instance of PropertySet.

Parameters:
basePropertySet - The base property set to base the property set upon.

PropertySet

public PropertySet(PropertyDefinitionBase... additionalProperties)
Initializes a new instance of PropertySet based upon BasePropertySet.IdOnly.

Parameters:
additionalProperties - Additional properties to include in the property set. Property definitions are available as static members from schema classes (for example, EmailMessageSchema.Subject, AppointmentSchema.Start, ContactSchema.GivenName, etc.)

PropertySet

public PropertySet(java.util.Iterator<PropertyDefinitionBase> additionalProperties)
Initializes a new instance of PropertySet based upon BasePropertySet.IdOnly.

Parameters:
additionalProperties - Additional properties to include in the property set. Property definitions are available as static members from schema classes (for example, EmailMessageSchema.Subject, AppointmentSchema.Start, ContactSchema.GivenName, etc.)
Method Detail

getFirstClassProperties

public static PropertySet getFirstClassProperties()
Returns a predefined property set that includes the first class properties of an item or folder.

Returns:
A predefined property set that includes the first class properties of an item or folder.

getPropertySetFromBasePropertySet

public static PropertySet getPropertySetFromBasePropertySet(BasePropertySet basePropertySet)
Implements an implicit conversion between PropertySet and BasePropertySet.

Parameters:
basePropertySet - The BasePropertySet value to convert from.
Returns:
A PropertySet instance based on the specified base property set.

add

public void add(PropertyDefinitionBase property)
         throws java.lang.Exception
* Adds the specified property to the property set.

Parameters:
property - The property to add.
Throws:
java.lang.Exception - the exception

addRange

public void addRange(java.lang.Iterable<PropertyDefinitionBase> properties)
              throws java.lang.Exception
* Adds the specified properties to the property set.

Parameters:
properties - The properties to add.
Throws:
java.lang.Exception - the exception

clear

public void clear()
Remove all explicitly added properties from the property set.


contains

public boolean contains(PropertyDefinitionBase property)
Determines whether the specified property has been explicitly added to this property set using the Add or AddRange methods.

Parameters:
property - The property.
Returns:
true if this property set contains the specified property otherwise, false

remove

public boolean remove(PropertyDefinitionBase property)
Removes the specified property from the set.

Parameters:
property - The property to remove.
Returns:
true if the property was successfully removed, false otherwise.

getBasePropertySet

public BasePropertySet getBasePropertySet()
* Gets the base property set, the property set is based upon.

Returns:
the base property set

getDefaultPropertySetMap

public static microsoft.exchange.webservices.data.LazyMember<java.util.Map<BasePropertySet,java.lang.String>> getDefaultPropertySetMap()
*Maps BasePropertySet values to EWS's BaseShape values.

Returns:
the base property set

setBasePropertySet

public void setBasePropertySet(BasePropertySet basePropertySet)
Sets the base property set, the property set is based upon.

Parameters:
basePropertySet - Base property set.

getRequestedBodyType

public BodyType getRequestedBodyType()
* Gets type of body that should be loaded on items. If RequestedBodyType is null, body is returned as HTML if available, plain text otherwise.

Returns:
the requested body type

setRequestedBodyType

public void setRequestedBodyType(BodyType requestedBodyType)
Sets type of body that should be loaded on items. If RequestedBodyType is null, body is returned as HTML if available, plain text otherwise.

Parameters:
requestedBodyType - Type of body that should be loaded on items.

getCount

public int getCount()
* Gets the number of explicitly added properties in this set.

Returns:
the count

getFilterHtmlContent

public java.lang.Boolean getFilterHtmlContent()
* Gets value indicating whether or not to filter potentially unsafe HTML content from message bodies.

Returns:
the filter html content

setFilterHtmlContent

public void setFilterHtmlContent(java.lang.Boolean filterHtml)
Sets value indicating whether or not to filter potentially unsafe HTML content from message bodies.

Parameters:
filterHtml - true to filter otherwise false.

getConvertHtmlCodePageToUTF8

public java.lang.Boolean getConvertHtmlCodePageToUTF8()
Gets value indicating whether or not to convert HTML code page to UTF8 encoding.


setConvertHtmlCodePageToUTF8

public void setConvertHtmlCodePageToUTF8(java.lang.Boolean value)
Sets value indicating whether or not to convert HTML code page to UTF8 encoding.


getPropertyDefinitionBaseAt

public PropertyDefinitionBase getPropertyDefinitionBaseAt(int index)
* Gets the PropertyDefinitionBase at the specified index.

Parameters:
index - Index.
Returns:
the property definition base at

validate

public void validate()
              throws ServiceValidationException
Validate.

Throws:
ServiceValidationException - the service validation exception

writeAdditionalPropertiesToXml

protected static void writeAdditionalPropertiesToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer,
                                                     java.util.Iterator<PropertyDefinitionBase> propertyDefinitions)
                                              throws javax.xml.stream.XMLStreamException,
                                                     ServiceXmlSerializationException
* Writes additonal properties to XML.

Parameters:
writer - The writer to write to.
propertyDefinitions - The property definitions to write.
Throws:
javax.xml.stream.XMLStreamException - the xML stream exception
ServiceXmlSerializationException - the service xml serialization exception

internalValidate

protected void internalValidate()
                         throws ServiceValidationException
* Validates this property set.

Throws:
ServiceValidationException - the service validation exception

validateForRequest

protected void validateForRequest(microsoft.exchange.webservices.data.ServiceRequestBase request,
                                  boolean summaryPropertiesOnly)
                           throws ServiceVersionException,
                                  ServiceValidationException
* Validates this property set instance for request to ensure that: 1. Properties are valid for the request server version 2. If only summary properties are legal for this request (e.g. FindItem) then only summary properties were specified.

Parameters:
request - The request.
summaryPropertiesOnly - if set to true then only summary properties are allowed.
Throws:
ServiceVersionException - the service version exception
ServiceValidationException - the service validation exception

writeToXml

protected void writeToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer,
                          ServiceObjectType serviceObjectType)
                   throws javax.xml.stream.XMLStreamException,
                          ServiceXmlSerializationException
* Writes the property set to XML.

Parameters:
writer - The writer to write to.
serviceObjectType - The type of service object the property set is emitted for.
Throws:
javax.xml.stream.XMLStreamException - the xML stream exception
ServiceXmlSerializationException - the service xml serialization exception

iterator

public java.util.Iterator<PropertyDefinitionBase> iterator()
Specified by:
iterator in interface java.lang.Iterable<PropertyDefinitionBase>