public class VToDo extends CalendarComponent
4.6.2 To-do Component
Component Name: VTODO
Purpose: Provide a grouping of calendar properties that describe a
to-do.
Formal Definition: A "VTODO" calendar component is defined by the
following notation:
todoc = "BEGIN" ":" "VTODO" CRLF
todoprop *alarmc
"END" ":" "VTODO" CRLF
todoprop = *(
; the following are optional,
; but MUST NOT occur more than once
class / completed / created / description / dtstamp /
dtstart / geo / last-mod / location / organizer /
percent / priority / recurid / seq / status /
summary / uid / url /
; either 'due' or 'duration' may appear in
; a 'todoprop', but 'due' and 'duration'
; MUST NOT occur in the same 'todoprop'
due / duration /
; the following are optional,
; and MAY occur more than once
attach / attendee / categories / comment / contact /
exdate / exrule / rstatus / related / resources /
rdate / rrule / x-prop
)
Example 1 - Creating a todo of two (2) hour duration starting tomorrow:
java.util.Calendar cal = java.util.Calendar.getInstance();
// tomorrow..
cal.add(java.util.Calendar.DAY_OF_MONTH, 1);
cal.set(java.util.Calendar.HOUR_OF_DAY, 11);
cal.set(java.util.Calendar.MINUTE, 00);
VToDo documentation = new VEvent(cal.getTime(), 1000 * 60 * 60 * 2,
"Document calendar component usage");
// add timezone information..
VTimeZone tz = VTimeZone.getDefault();
TzId tzParam = new TzId(tz.getProperties().getProperty(Property.TZID)
.getValue());
documentation.getProperties().getProperty(Property.DTSTART).getParameters()
.add(tzParam);
| Constructor and Description |
|---|
VToDo()
Default constructor.
|
VToDo(Date start,
Date due,
java.lang.String summary)
Constructs a new VTODO instance starting and ending at the specified times with the specified summary.
|
VToDo(Date start,
Dur duration,
java.lang.String summary)
Constructs a new VTODO instance starting at the specified times, for the specified duration, with the specified
summary.
|
VToDo(Date start,
java.lang.String summary)
Constructs a new VTODO instance starting at the specified time with the specified summary.
|
VToDo(PropertyList properties)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Component |
copy()
Overrides default copy method to add support for copying alarm sub-components.
|
boolean |
equals(java.lang.Object arg0)
Uses
EqualsBuilder to test equality. |
ComponentList |
getAlarms()
Returns the list of alarms for this todo.
|
Clazz |
getClassification() |
Created |
getCreated() |
Completed |
getDateCompleted() |
DtStamp |
getDateStamp() |
Description |
getDescription() |
Due |
getDue() |
Duration |
getDuration() |
Geo |
getGeographicPos() |
LastModified |
getLastModified() |
Location |
getLocation() |
Organizer |
getOrganizer() |
PercentComplete |
getPercentComplete() |
Priority |
getPriority() |
RecurrenceId |
getRecurrenceId() |
Sequence |
getSequence() |
DtStart |
getStartDate()
Convenience method to pull the DTSTART out of the property list.
|
Status |
getStatus() |
Summary |
getSummary() |
Uid |
getUid()
Returns the UID property of this component if available.
|
Url |
getUrl() |
int |
hashCode()
Uses
HashCodeBuilder to build hashcode. |
java.lang.String |
toString() |
void |
validate(boolean recurse)
Perform validation on a component.
|
void |
validateAdd()
Component/Property Presence
------------------- ----------------------------------------------
METHOD 1 MUST be "ADD"
VTODO 1
DTSTAMP 1
ORGANIZER 1
PRIORITY 1
SEQUENCE 1 MUST be greater than 0
SUMMARY 1 Can be null.
|
void |
validateCancel()
Component/Property Presence
------------------- ---------------------------------------------
METHOD 1 MUST be "CANCEL"
VTODO 1
ATTENDEE 0+ include all "Attendees" being removed from
the todo.
|
void |
validateCounter()
Component/Property Presence
------------------- ----------------------------------------------
METHOD 1 MUST be "COUNTER"
VTODO 1
ATTENDEE 1+
DTSTAMP 1
ORGANIZER 1
PRIORITY 1
SUMMARY 1 Can be null
UID 1
ATTACH 0+
CATEGORIES 0 or 1 This property MAY contain a list of values
CLASS 0 or 1
COMMENT 0 or 1
CONTACT 0+
CREATED 0 or 1
DESCRIPTION 0 or 1 Can be null
DTSTART 0 or 1
DUE 0 or 1 If present DURATION MUST NOT be present
DURATION 0 or 1 If present DUE MUST NOT be present
EXDATE 0+
EXRULE 0+
GEO 0 or 1
LAST-MODIFIED 0 or 1
LOCATION 0 or 1
PERCENT-COMPLETE 0 or 1
RDATE 0+
RECURRENCE-ID 0 or 1 MUST only 3.5if referring to an instance of a
recurring calendar component.
|
void |
validateDeclineCounter()
Component/Property Presence
------------------- ---------------------------------------------
METHOD 1 MUST be "DECLINECOUNTER"
VTODO 1
ATTENDEE 1+ MUST for all attendees
DTSTAMP 1
ORGANIZER 1
SEQUENCE 1 MUST echo the original SEQUENCE number
UID 1 MUST echo original UID
ATTACH 0+
CATEGORIES 0 or 1 This property may contain a list of values
CLASS 0 or 1
COMMENT 0 or 1
CONTACT 0+
CREATED 0 or 1
DESCRIPTION 0 or 1
DTSTART 0 or 1
DUE 0 or 1 If present DURATION MUST NOT be present
DURATION 0 or 1 If present DUE MUST NOT be present
EXDATE 0+
EXRULE 0+
GEO 0 or 1
LAST-MODIFIED 0 or 1
LOCATION 0 or 1
PERCENT-COMPLETE 0 or 1
PRIORITY 0 or 1
RDATE 0+
RECURRENCE-ID 0 or 1 MUST only if referring to an instance of a
recurring calendar component.
|
void |
validatePublish()
Component/Property Presence
------------------- ----------------------------------------------
METHOD 1 MUST be "PUBLISH"
VTODO 1+
DTSTAMP 1
DTSTART 1
ORGANIZER 1
PRIORITY 1
SEQUENCE 0 or 1 MUST be present if value is greater than
0, MAY be present if 0
SUMMARY 1 Can be null.
|
void |
validateRefresh()
Component/Property Presence
------------------- ---------------------------------------------
METHOD 1 MUST be "REFRESH"
VTODO 1
ATTENDEE 1
DTSTAMP 1
UID 1 MUST echo original UID
RECURRENCE-ID 0 or 1 MUST only if referring to an instance of a
Recurring calendar component.
|
void |
validateReply()
Component/Property Presence
------------------- ---------------------------------------------
METHOD 1 MUST be "REPLY"
VTODO 1+ All component MUST have the same UID
ATTENDEE 1+
DTSTAMP 1
ORGANIZER 1
REQUEST-STATUS 1+
UID 1 MUST must be the address of the replying
attendee
ATTACH 0+
CATEGORIES 0 or 1 This property may contain a list of values
CLASS 0 or 1
COMMENT 0 or 1
CONTACT 0+
CREATED 0 or 1
DESCRIPTION 0 or 1
DTSTART 0 or 1
DUE 0 or 1 If present DURATION MUST NOT be present
DURATION 0 or 1 If present DUE MUST NOT be present
EXDATE 0+
EXRULE 0+
GEO 0 or 1
LAST-MODIFIED 0 or 1
LOCATION 0 or 1
PERCENT-COMPLETE 0 or 1
PRIORITY 0 or 1
RDATE 0+
RELATED-TO 0+
RESOURCES 0 or 1 This property may contain a list of values
RRULE 0+
RECURRENCE-ID 0 or 1 MUST only if referring to an instance of a
Recurring calendar component.
|
void |
validateRequest()
Component/Property Presence
------------------- ----------------------------------------------
METHOD 1 MUST be "REQUEST"
VTODO 1+ All components must have the same UID
ATTENDEE 1+
DTSTAMP 1
DTSTART 1
ORGANIZER 1
PRIORITY 1
SEQUENCE 0 or 1 MUST be present if value is greater than
0, MAY be present if 0
SUMMARY 1 Can be null.
|
calculateRecurrenceSet, getName, getProperties, getProperties, getProperty, validate, validatePropertiespublic VToDo()
public VToDo(PropertyList properties)
properties - a list of propertiespublic VToDo(Date start, java.lang.String summary)
start - the start date of the new todosummary - the todo summarypublic VToDo(Date start, Date due, java.lang.String summary)
start - the start date of the new tododue - the due date of the new todosummary - the todo summarypublic VToDo(Date start, Dur duration, java.lang.String summary)
start - the start date of the new tododuration - the duration of the new todosummary - the todo summarypublic final ComponentList getAlarms()
public final java.lang.String toString()
public final void validate(boolean recurse)
throws ValidationException
Componentvalidate in class Componentrecurse - indicates whether to validate the component's propertiesValidationException - where the component is not in a valid statepublic void validatePublish()
throws ValidationException
Component/Property Presence
------------------- ----------------------------------------------
METHOD 1 MUST be "PUBLISH"
VTODO 1+
DTSTAMP 1
DTSTART 1
ORGANIZER 1
PRIORITY 1
SEQUENCE 0 or 1 MUST be present if value is greater than
0, MAY be present if 0
SUMMARY 1 Can be null.
UID 1
ATTACH 0+
CATEGORIES 0 or 1 This property may contain a list of values
CLASS 0 or 1
COMMENT 0 or 1
CONTACT 0+
CREATED 0 or 1
DESCRIPTION 0 or 1 Can be null
DUE 0 or 1 If present DURATION MUST NOT be present
DURATION 0 or 1 If present DUE MUST NOT be present
EXDATE 0+
EXRULE 0+
GEO 0 or 1
LAST-MODIFIED 0 or 1
LOCATION 0 or 1
PERCENT-COMPLETE 0 or 1
RDATE 0+
RECURRENCE-ID 0 or 1 MUST only if referring to an instance of a
recurring calendar component. Otherwise
it MUST NOT be present.
RELATED-TO 0+
RESOURCES 0 or 1 This property may contain a list of values
RRULE 0+
STATUS 0 or 1 MAY be one of COMPLETED/NEEDS ACTION/IN-
PROCESS/CANCELLED
URL 0 or 1
X-PROPERTY 0+
ATTENDEE 0
REQUEST-STATUS 0
VTIMEZONE 0+ MUST be present if any date/time refers to
a timezone
VALARM 0+
X-COMPONENT 0+
VFREEBUSY 0
VEVENT 0
VJOURNAL 0
validatePublish in class CalendarComponentValidationExceptionpublic void validateRequest()
throws ValidationException
Component/Property Presence
------------------- ----------------------------------------------
METHOD 1 MUST be "REQUEST"
VTODO 1+ All components must have the same UID
ATTENDEE 1+
DTSTAMP 1
DTSTART 1
ORGANIZER 1
PRIORITY 1
SEQUENCE 0 or 1 MUST be present if value is greater than
0, MAY be present if 0
SUMMARY 1 Can be null.
UID 1
ATTACH 0+
CATEGORIES 0 or 1 This property may contain a list of
values
CLASS 0 or 1
COMMENT 0 or 1
CONTACT 0+
CREATED 0 or 1
DESCRIPTION 0 or 1 Can be null
DUE 0 or 1 If present DURATION MUST NOT be present
DURATION 0 or 1 If present DUE MUST NOT be present
EXDATE 0+
EXRULE 0+
GEO 0 or 1
LAST-MODIFIED 0 or 1
LOCATION 0 or 1
PERCENT-COMPLETE 0 or 1
RDATE 0+
RECURRENCE-ID 0 or 1 present if referring to an instance of a
recurring calendar component. Otherwise
it MUST NOT be present.
RELATED-TO 0+
RESOURCES 0 or 1 This property may contain a list of
values
RRULE 0+
STATUS 0 or 1 MAY be one of COMPLETED/NEEDS ACTION/IN-
PROCESS
URL 0 or 1
X-PROPERTY 0+
REQUEST-STATUS 0
VALARM 0+
VTIMEZONE 0+ MUST be present if any date/time refers
to a timezone
X-COMPONENT 0+
VEVENT 0
VFREEBUSY 0
VJOURNAL 0
validateRequest in class CalendarComponentValidationExceptionpublic void validateReply()
throws ValidationException
Component/Property Presence
------------------- ---------------------------------------------
METHOD 1 MUST be "REPLY"
VTODO 1+ All component MUST have the same UID
ATTENDEE 1+
DTSTAMP 1
ORGANIZER 1
REQUEST-STATUS 1+
UID 1 MUST must be the address of the replying
attendee
ATTACH 0+
CATEGORIES 0 or 1 This property may contain a list of values
CLASS 0 or 1
COMMENT 0 or 1
CONTACT 0+
CREATED 0 or 1
DESCRIPTION 0 or 1
DTSTART 0 or 1
DUE 0 or 1 If present DURATION MUST NOT be present
DURATION 0 or 1 If present DUE MUST NOT be present
EXDATE 0+
EXRULE 0+
GEO 0 or 1
LAST-MODIFIED 0 or 1
LOCATION 0 or 1
PERCENT-COMPLETE 0 or 1
PRIORITY 0 or 1
RDATE 0+
RELATED-TO 0+
RESOURCES 0 or 1 This property may contain a list of values
RRULE 0+
RECURRENCE-ID 0 or 1 MUST only if referring to an instance of a
Recurring calendar component. Otherwise it
MUST NOT be present
SEQUENCE 0 or 1 MUST be the sequence number of
the original REQUEST if greater than 0.
MAY be present if 0.
STATUS 0 or 1
SUMMARY 0 or 1 Can be null
URL 0 or 1
X-PROPERTY 0+
VTIMEZONE 0 or 1 MUST be present if any date/time refers to
a timezone
X-COMPONENT 0+
VALARM 0
VEVENT 0
VFREEBUSY 0
validateReply in class CalendarComponentValidationExceptionpublic void validateAdd()
throws ValidationException
Component/Property Presence
------------------- ----------------------------------------------
METHOD 1 MUST be "ADD"
VTODO 1
DTSTAMP 1
ORGANIZER 1
PRIORITY 1
SEQUENCE 1 MUST be greater than 0
SUMMARY 1 Can be null.
UID 1 MUST match that of the original to-do
ATTACH 0+
ATTENDEE 0+
CATEGORIES 0 or 1 This property may contain a list of
values
CLASS 0 or 1
COMMENT 0 or 1
CONTACT 0+
CREATED 0 or 1
DESCRIPTION 0 or 1 Can be null
DTSTART 0 or 1
DUE 0 or 1 If present DURATION MUST NOT be present
DURATION 0 or 1 If present DUE MUST NOT be present
EXDATE 0+
EXRULE 0+
GEO 0 or 1
LAST-MODIFIED 0 or 1
LOCATION 0 or 1
PERCENT-COMPLETE 0 or 1
RDATE 0+
RELATED-TO 0+
RESOURCES 0 or 1 This property may contain a list of
values
RRULE 0+
STATUS 0 or 1 MAY be one of COMPLETED/NEEDS ACTION/IN-
PROCESS
URL 0 or 1
X-PROPERTY 0+
RECURRENCE-ID 0
REQUEST-STATUS 0
VALARM 0+
VTIMEZONE 0+ MUST be present if any date/time refers
to a timezone
X-COMPONENT 0+
VEVENT 0
VJOURNAL 0
VFREEBUSY 0
validateAdd in class CalendarComponentValidationExceptionpublic void validateCancel()
throws ValidationException
Component/Property Presence
------------------- ---------------------------------------------
METHOD 1 MUST be "CANCEL"
VTODO 1
ATTENDEE 0+ include all "Attendees" being removed from
the todo. MUST include all "Attendees" if
the entire todo is cancelled.
UID 1 MUST echo original UID
DTSTAMP 1
ORGANIZER 1
SEQUENCE 1
ATTACH 0+
CATEGORIES 0 or 1 This property MAY contain a list of values
CLASS 0 or 1
COMMENT 0 or 1
CONTACT 0+
CREATED 0 or 1
DESCRIPTION 0 or 1
DTSTART 0 or 1
DUE 0 or 1 If present DURATION MUST NOT be present
DURATION 0 or 1 If present DUE MUST NOT be present
EXDATE 0+
EXRULE 0+
GEO 0 or 1
LAST-MODIFIED 0 or 1
LOCATION 0 or 1
PERCENT-COMPLETE 0 or 1
RDATE 0+
RECURRENCE-ID 0 or 1 MUST only if referring to one or more
instances of a recurring calendar
component. Otherwise it MUST NOT be
present.
RELATED-TO 0+
RESOURCES 0 or 1 This property MAY contain a list of values
RRULE 0+
PRIORITY 0 or 1
STATUS 0 or 1 If present it MUST be set to "CANCELLED".
MUST NOT be used if purpose is to remove
"ATTENDEES" rather than cancel the entire
VTODO.
URL 0 or 1
X-PROPERTY 0+
REQUEST-STATUS 0
VTIMEZONE 0 or 1 MUST be present if any date/time refers to
a timezone
X-COMPONENT 0+
VALARM 0
VEVENT 0
VFREEBUSY 0
validateCancel in class CalendarComponentValidationExceptionpublic void validateRefresh()
throws ValidationException
Component/Property Presence
------------------- ---------------------------------------------
METHOD 1 MUST be "REFRESH"
VTODO 1
ATTENDEE 1
DTSTAMP 1
UID 1 MUST echo original UID
RECURRENCE-ID 0 or 1 MUST only if referring to an instance of a
Recurring calendar component. Otherwise it
MUST NOT be present
X-PROPERTY 0+
ATTACH 0
CATEGORIES 0
CLASS 0
COMMENT 0
CONTACT 0
CREATED 0
DESCRIPTION 0
DTSTART 0
DUE 0
DURATION 0
EXDATE 0
EXRULE 0
GEO 0
LAST-MODIFIED 0
LOCATION 0
ORGANIZER 0
PERCENT-COMPLETE 0
PRIORITY 0
RDATE 0
RELATED-TO 0
REQUEST-STATUS 0
RESOURCES 0
RRULE 0
SEQUENCE 0
STATUS 0
URL 0
X-COMPONENT 0+
VALARM 0
VEVENT 0
VFREEBUSY 0
VTIMEZONE 0
validateRefresh in class CalendarComponentValidationExceptionpublic void validateCounter()
throws ValidationException
Component/Property Presence
------------------- ----------------------------------------------
METHOD 1 MUST be "COUNTER"
VTODO 1
ATTENDEE 1+
DTSTAMP 1
ORGANIZER 1
PRIORITY 1
SUMMARY 1 Can be null
UID 1
ATTACH 0+
CATEGORIES 0 or 1 This property MAY contain a list of values
CLASS 0 or 1
COMMENT 0 or 1
CONTACT 0+
CREATED 0 or 1
DESCRIPTION 0 or 1 Can be null
DTSTART 0 or 1
DUE 0 or 1 If present DURATION MUST NOT be present
DURATION 0 or 1 If present DUE MUST NOT be present
EXDATE 0+
EXRULE 0+
GEO 0 or 1
LAST-MODIFIED 0 or 1
LOCATION 0 or 1
PERCENT-COMPLETE 0 or 1
RDATE 0+
RECURRENCE-ID 0 or 1 MUST only 3.5if referring to an instance of a
recurring calendar component. Otherwise it
MUST NOT be present.
RELATED-TO 0+
REQUEST-STATUS 0+
RESOURCES 0 or 1 This property MAY contain a list of values
RRULE 0 or 1
SEQUENCE 0 or 1 MUST echo the original SEQUENCE number.
MUST be present if non-zero. MAY be present
if zero.
STATUS 0 or 1 MAY be one of COMPLETED/NEEDS ACTION/IN-
PROCESS/CANCELLED
URL 0 or 1
X-PROPERTY 0+
VALARM 0+
VTIMEZONE 0 or 1 MUST be present if any date/time refers to
a timezone
X-COMPONENT 0+
VEVENT 0
VFREEBUSY 0
validateCounter in class CalendarComponentValidationExceptionpublic void validateDeclineCounter()
throws ValidationException
Component/Property Presence
------------------- ---------------------------------------------
METHOD 1 MUST be "DECLINECOUNTER"
VTODO 1
ATTENDEE 1+ MUST for all attendees
DTSTAMP 1
ORGANIZER 1
SEQUENCE 1 MUST echo the original SEQUENCE number
UID 1 MUST echo original UID
ATTACH 0+
CATEGORIES 0 or 1 This property may contain a list of values
CLASS 0 or 1
COMMENT 0 or 1
CONTACT 0+
CREATED 0 or 1
DESCRIPTION 0 or 1
DTSTART 0 or 1
DUE 0 or 1 If present DURATION MUST NOT be present
DURATION 0 or 1 If present DUE MUST NOT be present
EXDATE 0+
EXRULE 0+
GEO 0 or 1
LAST-MODIFIED 0 or 1
LOCATION 0 or 1
PERCENT-COMPLETE 0 or 1
PRIORITY 0 or 1
RDATE 0+
RECURRENCE-ID 0 or 1 MUST only if referring to an instance of a
recurring calendar component. Otherwise
it MUST NOT be present.
RELATED-TO 0+
REQUEST-STATUS 0+
RESOURCES 0 or 1 This property MAY contain a list of values
RRULE 0+
STATUS 0 or 1 MAY be one of COMPLETED/NEEDS ACTION/IN-
PROCESS
URL 0 or 1
X-PROPERTY 0+
VTIMEZONE 0+ MUST be present if any date/time refers to
a timezone
X-COMPONENT 0+
VALARM 0
VEVENT 0
VFREEBUSY 0
validateDeclineCounter in class CalendarComponentValidationExceptionpublic final Clazz getClassification()
public final Completed getDateCompleted()
public final Created getCreated()
public final Description getDescription()
public final DtStart getStartDate()
public final Geo getGeographicPos()
public final LastModified getLastModified()
public final Location getLocation()
public final Organizer getOrganizer()
public final PercentComplete getPercentComplete()
public final Priority getPriority()
public final DtStamp getDateStamp()
public final Sequence getSequence()
public final Status getStatus()
public final Summary getSummary()
public final Url getUrl()
public final RecurrenceId getRecurrenceId()
public final Duration getDuration()
public final Due getDue()
public final Uid getUid()
public boolean equals(java.lang.Object arg0)
ComponentEqualsBuilder to test equality. Two components are equal if and only if their name and property lists
are equal.public int hashCode()
ComponentHashCodeBuilder to build hashcode.public Component copy() throws java.text.ParseException, java.io.IOException, java.net.URISyntaxException
copy in class Componentjava.text.ParseExceptionjava.io.IOExceptionjava.net.URISyntaxExceptionComponent.copy()