- Direct Known Subclasses:
ICalBuilder.CommonWithAlarm
,ICalBuilder.Journal
- Enclosing class:
- ICalBuilder
-
Field Summary
Fields inherited from class org.bzdev.net.calendar.ICalBuilder.Base
contentLines
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Common
(String uid, int sequence, TemporalAccessor created, TemporalAccessor lastModified) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttendee
(String uri, String... params) Add an attendee.void
addCategories
(String lang, String... categories) Add the categories for an iCalendar component.void
addComment
(String comment, String... parameters) Add a comment to attach to this iCalendar component Comments are described in Section 3.8.1.4 of RFC 5545.void
addContact
(String contact, String... parameters) Add a contact.void
addRelatedTo
(String reltype, String id) Add a property indicating that another iCalendar component is related to this one.protected void
Clear the content lines.protected void
Create the content for this event (a sequence of lines) that will make up part of an iCalendar file).void
setClassification
(String classification) Set the classification of this iCalendar component.protected void
setDescription
(String description, String... parameters) Set the description for this event.void
setGeo
(double latitude, double longitude) Specify a latitude and longitude for an iCalendar component.protected void
setLocation
(String location, String... parameters) Set the location for this iCalendar component.protected void
setPriority
(int priority) Set the priority of this iCalendar component.protected void
setStartTime
(TemporalAccessor startTime, String... parameters) Set the start time for this iCalendar component.protected void
setStatus
(ICalBuilder.Status status) Set the status of this iCalendar component.protected void
setSummary
(String summary, String... parameters) Set the summary property for this event.void
Set the URL property for this iCalendar component.Methods inherited from class org.bzdev.net.calendar.ICalBuilder.Base
addAttachment, addAttachment, addProperty, addProperty, addProperty, setDuration
-
Constructor Details
-
Common
protected Common(String uid, int sequence, TemporalAccessor created, TemporalAccessor lastModified) throws IllegalArgumentException Constructor. The first argument (uid) is described in Section 3.8.4.7 of RFC 5545. The second argument (sequence) is described in Section 3.8.7.4 of RFC 5545. The third argument (created) is described in Section 3.8.7.1 of RFC 5545. The fourth argument (lastModified) is described in Section of 3.8.7.3 RFC 5545.The types of the
TemporalAccessor
arguments must be eitherLocalDate
,LocalDateTime
,ZonedDateTime
, orInstant
, The classesLocalDate
andLocalDateTime
will be treated as a "floating time" (see RFC 5545) and bothZonedDateTime
andInstant
will have their times represented using UTC. To convert a LocalDate value to a LocalDateTime value, use methods such asLocalDate.atStartOfDay()
. To convert a LocalDateTime value to a ZonedDateTime object, use the methodLocalDateTime.atZone(java.time.ZoneId)
. To get the default time zone for the Java virtual machine, use the methodZoneId.systemDefault()
.- Parameters:
uid
- the globally unique identifier for this iCalendar componentsequence
- a sequence number labeling changes to this iCalendar componentcreated
- the time at which this iCalendar component was createdlastModified
- the last time at which this iCalendar component was modified- Throws:
IllegalArgumentException
- an argument was null or the sequence number was negative, the uid argument was null, or an unrecoginzed time format was used (wrong subclass of TemporalAccessor)
-
-
Method Details
-
setStartTime
protected void setStartTime(TemporalAccessor startTime, String... parameters) throws IllegalArgumentException Set the start time for this iCalendar component. Please see Section 3.8.2.4 of RFC 5545 for a description of the start-time property. Parameters should not be used unless the run-time type of the first argument isLocalDate
orLocalDateTime
. The parameters defined by RFC 5545 are- VALUE. Values (which follow an "=" character) can be DATE-TIME or DATE.
- TZID. Please see Section 3.2.19 of RFC 5545.
The type of the
TemporalAccessor
argument must be eitherLocalDate
,LocalDateTime
,ZonedDateTime
, orInstant
, The classesLocalDate
andLocalDateTime
will be treated as a "floating time" (see RFC 5545) and bothZonedDateTime
andInstant
will have their times represented using UTC. To convert a LocalDate value to a LocalDateTime value, use methods such asLocalDate.atStartOfDay()
. To convert a LocalDateTime value to a ZonedDateTime object, use the methodLocalDateTime.atZone(java.time.ZoneId)
. To get the default time zone for the Java virtual machine, use the methodZoneId.systemDefault()
.- Parameters:
startTime
- the time at which the activity represented by this iCalendar component startsparameters
- the parameters for the start time, if any- Throws:
IllegalArgumentException
- the temporal accessor argument's type is not a recognized subclass of TemporalAccesssor
-
setSummary
Set the summary property for this event. The first argument is typically a short string describing an event and is described in Section 3.8.1.12 of RFC 5545. Parameters defined by RFC 5545 for a summary are LANGUAGE and ALTREP.- Parameters:
summary
- a summary describing this event; null if there is no summaryparameters
- the parameters for this property
-
setDescription
Set the description for this event. The description of an iCalendar component and is described in Section 3.8.1.5 of RFC 5545.Parameters defined by RFC 5545 for a description are LANGUAGE and ALTREP.
- Parameters:
description
- a full description of this event; null if there is no descriptionparameters
- the parameters for this property
-
setLocation
Set the location for this iCalendar component. The location property describes the location of an event and is described in Section 3.8.1.7 of RFC 5545.Parameters defined by RFC 5545 for a comment are LANGUAGE and ALTREP.
- Parameters:
location
- the location for this event; null if no location is specifiedparameters
- the parameters for this property
-
addComment
Add a comment to attach to this iCalendar component Comments are described in Section 3.8.1.4 of RFC 5545.Parameters defined by RFC 5545 for a comment are LANGUAGE and ALTREP.
- Parameters:
comment
- the comment.parameters
- the parameters for this property
-
setClassification
Set the classification of this iCalendar component. Allowed values are PUBLIC, PRIVATE, CONFIDENTIAL, an IANA token (any iCalendar identifier registered with IANA), or a token of the form X-<vendorid>-<word> where -<word> is a non-empty sequence of letters (alpha characters), digits, and "-". The classification property is describe in Section 8.3.1.3 of RFC 5545.As of December 23, 2019, the only classifications registered with IANA are PUBLIC, PRIVATE, and CONFIDENTIAL.
- Parameters:
classification
- the classification.
-
addCategories
Add the categories for an iCalendar component. Each category is a user-specified string that can be used for search purposes. Each category will typically be a keyword useful for searching for particular types of calendar components. Categories are described in Section 3.8.1.2 of RFC 5545. Language values are described in Section 3.2.10 of RFC 5545 and RFC 5646.- Parameters:
lang
- the language for this componentcategories
- the categories
-
setStatus
Set the status of this iCalendar component. The status property is described in Section 3.8.1.11 of RFC 5545.- Parameters:
status
- the status; null to clear the status- Throws:
IllegalArgumentException
- the status is not allowed for this iCalendar component
-
setPriority
protected void setPriority(int priority) Set the priority of this iCalendar component. Please see Section 3.8.1.9 of RFC 5545 for a description of the priority property.- Parameters:
priority
- the priority, a value in the range [0, 9]
-
setURL
Set the URL property for this iCalendar component. Section 3.8.4.6 of RFC 5545.- Parameters:
uri
- the URL's URI; null if there is none
-
addRelatedTo
Add a property indicating that another iCalendar component is related to this one. Section 3.8.4.5 of RFC 5545.- Parameters:
reltype
- the type of relation (PARENT, CHILD, SIBLING, or a token starting with "X-"); null if there should be no RELTYPE parameterid
- the unique identifier of the other component- Throws:
IllegalArgumentException
-
setGeo
public void setGeo(double latitude, double longitude) Specify a latitude and longitude for an iCalendar component. Section 3.8.1.6 of RFC 5545.- Parameters:
latitude
- the latitude in degrees and between -90.0 and 9.0 inclusivelongitude
- the longitude in degrees and between -180.0 inclusive and 180.0 exclusive
-
addContact
Add a contact. A contact is a textual field as describe in Section 3.8.4.2 of RFC 5545.Parameters defined by RFC 5545 for a contact are LANGUAGE and ALTREP.
- Parameters:
contact
- the contactparameters
- the parameters as defined in RFC 5545- Throws:
IllegalArgumentException
- the argument was null
-
addAttendee
Add an attendee. The first argument is a URI denoting the attendee (for example, a "mailto" URI). The attendee property is described in Section 3.8.4.1 of RFC 5545. This section also describes the parameters for this property. Two particularly useful parameters are the "CN" property, which provides a common name for the attendee, and the "CUTYPE" parameter, whose values can be INDIVIDUAL, GROUP, RESOURCE, ROOM, UNKNOWN, or an experimental type starting with "X-" or an IANA-registered type not listed above. Please see Section 3.2.2 of RFC 5545 and Section 3.2.3 of RFC 5545 respectively for these two parameters. The language parameter LANGUAGE may be useful as well.- Parameters:
uri
- a URI denoting an attendeeparams
- additional parameters as defined in RFC 5545
-
createContentLines
Create the content for this event (a sequence of lines) that will make up part of an iCalendar file).- Overrides:
createContentLines
in classICalBuilder.Base
- Throws:
IllegalStateException
-
clearContentLines
protected void clearContentLines()Description copied from class:ICalBuilder.Base
Clear the content lines. Subclasses that override this method must call super.clearContentLines().- Overrides:
clearContentLines
in classICalBuilder.Base
-