microsoft.exchange.webservices.data
Class Recurrence

java.lang.Object
  extended by microsoft.exchange.webservices.data.ComplexProperty
      extended by microsoft.exchange.webservices.data.Recurrence
Direct Known Subclasses:
Recurrence.IntervalPattern, Recurrence.RelativeYearlyPattern, Recurrence.YearlyPattern

public abstract class Recurrence
extends ComplexProperty

Represents a recurrence pattern, as used by Appointment and Task items.


Nested Class Summary
static class Recurrence.DailyPattern
          Represents a recurrence pattern where each occurrence happens a specific number of days after the previous one.
static class Recurrence.DailyRegenerationPattern
          Represents a regeneration pattern, as used with recurring tasks, where each occurrence happens a specified number of days after the previous one is completed.
static class Recurrence.IntervalPattern
          Represents a recurrence pattern where each occurrence happens at a specific interval after the previous one.
static class Recurrence.MonthlyPattern
          Represents a recurrence pattern where each occurrence happens on a specific day a specific number of months after the previous one.
static class Recurrence.MonthlyRegenerationPattern
          Represents a regeneration pattern, as used with recurring tasks, where each occurrence happens a specified number of months after the previous one is completed.
static class Recurrence.RelativeMonthlyPattern
          Represents a recurrence pattern where each occurrence happens on a relative day a specific number of months after the previous one.
static class Recurrence.RelativeYearlyPattern
          The Class RelativeYearlyPattern.
static class Recurrence.WeeklyPattern
          Represents a recurrence pattern where each occurrence happens on specific days a specific number of weeks after the previous one.
static class Recurrence.WeeklyRegenerationPattern
          Represents a regeneration pattern, as used with recurring tasks, where each occurrence happens a specified number of weeks after the previous one is completed.
static class Recurrence.YearlyPattern
          Represents a recurrence pattern where each occurrence happens on a specific day every year.
static class Recurrence.YearlyRegenerationPattern
          Represents a regeneration pattern, as used with recurring tasks, where each occurrence happens a specified number of years after the previous one is completed.
 
Constructor Summary
protected Recurrence()
          Initializes a new instance.
protected Recurrence(java.util.Date startDate)
          Initializes a new instance.
 
Method Summary
 java.util.Date getEndDate()
          Gets the date after which the recurrence ends.
protected
<T> T
getFieldValueOrThrowIfNull(java.lang.Class<T> cls, java.lang.Object value, java.lang.String name)
          Gets a property value or throw if null.
 java.lang.Integer getNumberOfOccurrences()
          Gets the number of occurrences after which the recurrence ends.
 java.util.Date getStartDate()
          Gets the date and time when the recurrence start.
protected abstract  java.lang.String getXmlElementName()
          Gets the name of the XML element.
 boolean hasEnd()
          Gets a value indicating whether the pattern has a fixed number of occurrences or an end date.
protected  void internalValidate()
          Validates this instance.
protected  void internalWritePropertiesToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          Write properties to XML.
protected  boolean isRegenerationPattern()
          Gets a value indicating whether this instance is regeneration pattern.
 void neverEnds()
          Sets up this recurrence so that it never ends.
 void setEndDate(java.util.Date value)
          sets the date after which the recurrence ends.
 void setNumberOfOccurrences(java.lang.Integer value)
          Gets the number of occurrences after which the recurrence ends.
 void setStartDate(java.util.Date value)
          sets the date and time when the recurrence start.
protected  void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          Writes elements to XML.
 
Methods inherited from class microsoft.exchange.webservices.data.ComplexProperty
addOnChangeEvent, canSetFieldValue, changed, clearChangeEvents, clearChangeLog, func, getNamespace, loadFromXml, loadFromXml, readAttributesFromXml, readTextValueFromXml, removeChangeEvent, setNamespace, tryReadElementFromXml, tryReadElementFromXmlToPatch, updateFromXml, updateFromXml, validate, writeAttributesToXml, writeToXml, writeToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Recurrence

protected Recurrence()
Initializes a new instance.


Recurrence

protected Recurrence(java.util.Date startDate)
Initializes a new instance.

Parameters:
startDate - the start date
Method Detail

getXmlElementName

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

Returns:
the xml element name

isRegenerationPattern

protected boolean isRegenerationPattern()
Gets a value indicating whether this instance is regeneration pattern.

Returns:
true, if is regeneration pattern

internalWritePropertiesToXml

protected void internalWritePropertiesToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                                     throws javax.xml.stream.XMLStreamException,
                                            ServiceXmlSerializationException,
                                            ServiceValidationException,
                                            java.lang.Exception
Write properties to XML.

Parameters:
writer - the writer
Throws:
javax.xml.stream.XMLStreamException - the xML stream exception
ServiceXmlSerializationException - the service xml serialization exception
ServiceValidationException - the service validation exception
java.lang.Exception - the exception

writeElementsToXml

protected final 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

getFieldValueOrThrowIfNull

protected <T> T getFieldValueOrThrowIfNull(java.lang.Class<T> cls,
                                           java.lang.Object value,
                                           java.lang.String name)
                                throws ServiceValidationException
Gets a property value or throw if null. *

Type Parameters:
T - the generic type
Parameters:
cls - the cls
value - the value
name - the name
Returns:
Property value
Throws:
ServiceValidationException - the service validation exception

getStartDate

public java.util.Date getStartDate()
                            throws ServiceValidationException
Gets the date and time when the recurrence start.

Returns:
Date
Throws:
ServiceValidationException - the service validation exception

setStartDate

public void setStartDate(java.util.Date value)
sets the date and time when the recurrence start.

Parameters:
value - the new start date

hasEnd

public boolean hasEnd()
Gets a value indicating whether the pattern has a fixed number of occurrences or an end date.

Returns:
boolean

neverEnds

public void neverEnds()
Sets up this recurrence so that it never ends. Calling NeverEnds is equivalent to setting both NumberOfOccurrences and EndDate to null.


internalValidate

protected void internalValidate()
                         throws java.lang.Exception
Validates this instance.

Overrides:
internalValidate in class ComplexProperty
Throws:
java.lang.Exception

getNumberOfOccurrences

public java.lang.Integer getNumberOfOccurrences()
Gets the number of occurrences after which the recurrence ends. Setting NumberOfOccurrences resets EndDate.

Returns:
the number of occurrences

setNumberOfOccurrences

public void setNumberOfOccurrences(java.lang.Integer value)
                            throws ArgumentException
Gets the number of occurrences after which the recurrence ends. Setting NumberOfOccurrences resets EndDate.

Parameters:
value - the new number of occurrences
Throws:
ArgumentException - the argument exception

getEndDate

public java.util.Date getEndDate()
Gets the date after which the recurrence ends. Setting EndDate resets NumberOfOccurrences.

Returns:
the end date

setEndDate

public void setEndDate(java.util.Date value)
sets the date after which the recurrence ends. Setting EndDate resets NumberOfOccurrences.

Parameters:
value - the new end date