Class VCalendar

All Implemented Interfaces:
VElement, VParent

public class VCalendar extends VParentBase<VCalendar>
iCalendar Object RFC 5545, 3.4, page 50 Parent calendar object represents a collection of calendaring and scheduling information
  • Field Details

  • Constructor Details

    • VCalendar

      public VCalendar()
      Creates an empty VCalendar
    • VCalendar

      public VCalendar(VCalendar source)
      Copy constructor
  • Method Details

    • name

      public String name()
      Description copied from interface: VElement

      Returns the name of the component as it would appear in the iCalendar content line.

      Examples:

      • VEVENT
      • SUMMARY
      • LANGUAGE

      Returns:
      - the component name
    • getCalendarScale

      public CalendarScale getCalendarScale()
      CALSCALE: RFC 5545 iCalendar 3.7.1. page 76 This property defines the calendar scale used for the calendar information specified in the iCalendar object. This project is based on the Gregorian calendar scale. The Gregorian calendar scale is assumed if this property is not specified in the iCalendar object. It is expected that other calendar scales will be defined in other specifications or by future versions of iCalendar. The default value is "GREGORIAN" Example: CALSCALE:GREGORIAN
    • setCalendarScale

      public void setCalendarScale(String calendarScale)
    • setCalendarScale

      public void setCalendarScale(CalendarScale calendarScale)
    • withCalendarScale

      public VCalendar withCalendarScale(CalendarScale calendarScale)
    • withCalendarScale

      public VCalendar withCalendarScale(String calendarScale)
    • getMethod

      public Method getMethod()
      METHOD: RFC 5545 iCalendar 3.7.2. page 77 This property defines the iCalendar object method associated with the calendar object Example: METHOD:REQUEST
    • setMethod

      public void setMethod(String method)
    • setMethod

      public void setMethod(Method method)
    • setMethod

      public void setMethod(Method.MethodType method)
    • withMethod

      public VCalendar withMethod(Method method)
    • withMethod

      public VCalendar withMethod(Method.MethodType method)
    • withMethod

      public VCalendar withMethod(String method)
    • getProductIdentifier

      public ProductIdentifier getProductIdentifier()
      PRODID: RFC 5545 iCalendar 3.7.3. page 78 This property specifies the identifier for the product that created the iCalendar object This project is named JFxtras iCalendar Example: PRODID:-//JFxtras//JFXtras iCalendar 1.0//EN
    • setProductIdentifier

      public void setProductIdentifier(String productIdentifier)
    • setProductIdentifier

      public void setProductIdentifier(ProductIdentifier productIdentifier)
    • withProductIdentifier

      public VCalendar withProductIdentifier(ProductIdentifier productIdentifier)
    • withProductIdentifier

      public VCalendar withProductIdentifier(String productIdentifier)
    • getVersion

      public Version getVersion()
      VERSION: RFC 5545 iCalendar 3.7.4. page 79 This property specifies the identifier corresponding to the highest version number or the minimum and maximum range of the iCalendar specification that is required in order to interpret the iCalendar object. This project complies with version 2.0 Example: VERSION:2.0
    • setVersion

      public void setVersion(String version)
    • setVersion

      public void setVersion(Version version)
    • withVersion

      public VCalendar withVersion(Version version)
    • withVersion

      public VCalendar withVersion(String version)
    • withVersion

      public VCalendar withVersion()
    • getNonStandard

      public List<NonStandardProperty> getNonStandard()
    • setNonStandard

      public void setNonStandard(List<NonStandardProperty> nonStandardProps)
    • withNonStandard

      public VCalendar withNonStandard(List<NonStandardProperty> nonStandardProps)
      Sets the value of the
      invalid reference
      #nonStandardProperty()
      Returns:
      - this class for chaining
    • withNonStandard

      public VCalendar withNonStandard(String... nonStandardProps)
      Sets the value of the
      invalid reference
      #nonStandardProperty()
      by parsing a vararg of iCalendar content text representing individual NonStandardProperty objects.
      Returns:
      - this class for chaining
    • withNonStandard

      public VCalendar withNonStandard(NonStandardProperty... nonStandardProps)
      Sets the value of the
      invalid reference
      #nonStandardProperty()
      from a vararg of NonStandardProperty objects.
      Returns:
      - this class for chaining
    • getVEvents

      public List<VEvent> getVEvents()
      VEVENT: RFC 5545 iCalendar 3.6.1. page 52 A grouping of component properties that describe an event.
    • setVEvents

      public void setVEvents(List<VEvent> vEvents)
    • withVEvents

      public VCalendar withVEvents(List<VEvent> vEvents)
    • withVEvents

      public VCalendar withVEvents(String... vEvents)
    • withVEvents

      public VCalendar withVEvents(VEvent... vEvents)
    • getVTodos

      public List<VTodo> getVTodos()
      VTODO: RFC 5545 iCalendar 3.6.2. page 55 A grouping of component properties that describe a task that needs to be completed.
    • setVTodos

      public void setVTodos(List<VTodo> vTodos)
    • withVTodos

      public VCalendar withVTodos(List<VTodo> vTodos)
    • withVTodos

      public VCalendar withVTodos(String... vTodos)
    • withVTodos

      public VCalendar withVTodos(VTodo... vTodos)
    • getVJournals

      public List<VJournal> getVJournals()
      VJOURNAL: RFC 5545 iCalendar 3.6.3. page 57 A grouping of component properties that describe a task that needs to be completed.
      See Also:
    • setVJournals

      public void setVJournals(List<VJournal> vJournals)
    • withVJournals

      public VCalendar withVJournals(List<VJournal> vJournals)
    • withVJournals

      public VCalendar withVJournals(String... vJournals)
    • withVJournals

      public VCalendar withVJournals(VJournal... vJournals)
    • getVFreeBusies

      public List<VFreeBusy> getVFreeBusies()
      VFREEBUSY: RFC 5545 iCalendar 3.6.4. page 59
      See Also:
    • setVFreeBusys

      public void setVFreeBusys(List<VFreeBusy> vFreeBusys)
    • withVFreeBusies

      public VCalendar withVFreeBusies(List<VFreeBusy> vFreeBusys)
    • withVFreeBusies

      public VCalendar withVFreeBusies(String... vFreeBusys)
    • withVFreeBusies

      public VCalendar withVFreeBusies(VFreeBusy... vFreeBusys)
    • getVTimeZones

      public List<VTimeZone> getVTimeZones()
      VTIMEZONE: RFC 5545 iCalendar 3.6.5. page 62
      See Also:
    • setVTimeZones

      public void setVTimeZones(List<VTimeZone> vTimeZones)
    • withVTimeZones

      public VCalendar withVTimeZones(List<VTimeZone> vTimeZones)
    • withVTimeZones

      public VCalendar withVTimeZones(String... vTimeZones)
    • withVTimeZones

      public VCalendar withVTimeZones(VTimeZone... vTimeZones)
    • getVComponents

      public List<? extends VComponent> getVComponents(VComponent vComponent)
      A convenience method that returns parent list of the VComponent parameter. Returns null if component is not in any VComponent list.
      Parameters:
      vComponent - - VComponent to look up
    • setMethodProcessFactory

      public void setMethodProcessFactory(AbstractITIPFactory iTIPFactory)
      set AbstractITIPFactory to handle processing input VCalendar based on Method
    • getITIPFactory

      public AbstractITIPFactory getITIPFactory()
      get AbstractITIPFactory to handle processing input VCalendar based on Method
    • processITIPMessage

      public List<String> processITIPMessage(VCalendar... iTIPMessages)
      Process the exchange of iCalendar object according to the iTIP methods identifies in RFC 5546 based on the methods in getITIPFactory()
      Parameters:
      iTIPMessages - iTIP VCalendars to process with Method populated
      Returns:
      - log of process operation
    • processITIPMessage

      public List<String> processITIPMessage(Collection<VCalendar> iTIPMessages)
      Process the exchange of iCalendar object according to the iTIP methods identifies in RFC 5546 based on the methods in getITIPFactory()
      Parameters:
      iTIPMessages - iTIP VCalendars to process with Method populated
      Returns:
      - log of process operation
    • processITIPMessage

      public List<String> processITIPMessage(String iTIPMessages)
      Process the exchange of iCalendar object according to the iTIP methods identifies in RFC 5546. Input string can contain multiple iTIP VCALENDAR messages.
      Parameters:
      iTIPMessages - iTIP VCalendar Message strings
      Returns:
      - log of process operation
    • importVComponent

      @Deprecated public VComponent importVComponent(String contentText)
      Deprecated.
      Parse component text to new VComponent with REQUEST-STATUS properties containing the result of the process, such as success message or error report.
      Parameters:
      contentText - iCalendar content lines
      Returns:
      the created VComponent with REQUEST-STATUS populated to indicate success or failuer.
    • importVComponent

      @Deprecated public List<String> importVComponent(VComponent newVComponent)
      Deprecated.
      Import new VComponent with REQUEST-STATUS properties containing the result of the process, such as success message or error report.
      Parameters:
      contentText - iCalendar content lines
      Returns:
      list of error messages if import failed, null if successful
    • errors

      public List<String> errors()
      Description copied from interface: VElement
      Produces a list of error messages indicating problems with calendar element VElement.errors() is invoked recursively to return errors of child elements in addition to errors in parent
      Specified by:
      errors in interface VElement
      Overrides:
      errors in class VParentBase<VCalendar>
      Returns:
      - list of error messages
    • parse

      public static VCalendar parse(Reader reader) throws IOException
      Parse unfolded content line iterator into calendar object
      Throws:
      IOException
    • parse

      public static VCalendar parse(Path icsFilePath) throws IOException
      Creates a new VCalendar from an ics file
      Parameters:
      icsFilePath - path of ics file to parse
      Returns:
      Created VCalendar
      Throws:
      IOException
    • parseICalendarFile

      public static VCalendar parseICalendarFile(Path icsFilePath, boolean useResourceStatus) throws IOException
      Creates a new VCalendar from an ics file
      Parameters:
      icsFilePath - path of ics file to parse
      Returns:
      Created VCalendar
      Throws:
      IOException
    • parseICalendarFile

      public static VCalendar parseICalendarFile(Path icsFilePath) throws IOException
      Creates a new VCalendar from an ics file
      Parameters:
      icsFilePath - path of ics file to parse
      Returns:
      Created VCalendar
      Throws:
      IOException
    • isContentValid

      protected boolean isContentValid(String valueContent)
      Overrides:
      isContentValid in class VElementBase
    • parse

      public static VCalendar parse(String content)
      Creates a new VCalendar calendar component by parsing a String of iCalendar content lines
      Parameters:
      content - the text to parse, not null
      Returns:
      the parsed VCalendar