Class ICalBuilder.Common

java.lang.Object
org.bzdev.net.calendar.ICalBuilder.Base
org.bzdev.net.calendar.ICalBuilder.Common
Direct Known Subclasses:
ICalBuilder.CommonWithAlarm, ICalBuilder.Journal
Enclosing class:
ICalBuilder

public abstract static class ICalBuilder.Common extends ICalBuilder.Base
Superclass for those ICalendar components have a unique ID.
  • Constructor Details

  • 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 is LocalDate or LocalDateTime. The parameters defined by RFC 5545 are

      The type of the TemporalAccessor argument must be either LocalDate, LocalDateTime, ZonedDateTime, or Instant, The classesLocalDate and LocalDateTime will be treated as a "floating time" (see RFC 5545) and both ZonedDateTime and Instant will have their times represented using UTC. To convert a LocalDate value to a LocalDateTime value, use methods such as LocalDate.atStartOfDay(). To convert a LocalDateTime value to a ZonedDateTime object, use the method LocalDateTime.atZone(java.time.ZoneId). To get the default time zone for the Java virtual machine, use the method ZoneId.systemDefault().

      Parameters:
      startTime - the time at which the activity represented by this iCalendar component starts
      parameters - the parameters for the start time, if any
      Throws:
      IllegalArgumentException - the temporal accessor argument's type is not a recognized subclass of TemporalAccesssor
    • setSummary

      protected void setSummary(String summary, String... parameters)
      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 summary
      parameters - the parameters for this property
    • setDescription

      protected void setDescription(String description, String... parameters)
      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 description
      parameters - the parameters for this property
    • setLocation

      protected void setLocation(String location, String... parameters)
      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 specified
      parameters - the parameters for this property
    • addComment

      public 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.

      Parameters defined by RFC 5545 for a comment are LANGUAGE and ALTREP.

      Parameters:
      comment - the comment.
      parameters - the parameters for this property
    • setClassification

      public void setClassification(String classification)
      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

      public void addCategories(String lang, String... categories)
      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 component
      categories - the categories
    • setStatus

      protected void setStatus(ICalBuilder.Status status) throws IllegalArgumentException
      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

      public void setURL(String uri)
      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

      public void addRelatedTo(String reltype, String id) throws IllegalArgumentException
      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 parameter
      id - 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 inclusive
      longitude - the longitude in degrees and between -180.0 inclusive and 180.0 exclusive
    • addContact

      public void addContact(String contact, String... parameters)
      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 contact
      parameters - the parameters as defined in RFC 5545
      Throws:
      IllegalArgumentException - the argument was null
    • addAttendee

      public void addAttendee(String uri, String... params)
      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 attendee
      params - additional parameters as defined in RFC 5545
    • createContentLines

      protected void createContentLines() throws IllegalStateException
      Create the content for this event (a sequence of lines) that will make up part of an iCalendar file).
      Overrides:
      createContentLines in class ICalBuilder.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 class ICalBuilder.Base