Class CalendarBuilder

  • All Implemented Interfaces:
    Consumer<Calendar>

    public class CalendarBuilder
    extends Object
    implements Consumer<Calendar>
    Parses and builds an iCalendar model from an input stream. Note that this class is not thread-safe.
    • Method Detail

      • build

        public Calendar build​(InputStream in)
                       throws IOException,
                              ParserException
        Builds an iCalendar model from the specified input stream.
        Parameters:
        in - an input stream to read calendar data from
        Returns:
        a calendar parsed from the specified input stream
        Throws:
        IOException - where an error occurs reading data from the specified stream
        ParserException - where an error occurs parsing data from the stream
      • build

        public Calendar build​(Reader in)
                       throws IOException,
                              ParserException
        Builds an iCalendar model from the specified reader. An UnfoldingReader is applied to the specified reader to ensure the data stream is correctly unfolded where appropriate.
        Parameters:
        in - a reader to read calendar data from
        Returns:
        a calendar parsed from the specified reader
        Throws:
        IOException - where an error occurs reading data from the specified reader
        ParserException - where an error occurs parsing data from the reader
      • build

        public Calendar build​(UnfoldingReader uin)
                       throws IOException,
                              ParserException
        Build an iCalendar model by parsing data from the specified reader.
        Parameters:
        uin - an unfolding reader to read data from
        Returns:
        a calendar parsed from the specified reader
        Throws:
        IOException - where an error occurs reading data from the specified reader
        ParserException - where an error occurs parsing data from the reader
      • getRegistry

        public final TimeZoneRegistry getRegistry()
        Returns the timezone registry used in the construction of calendars.
        Returns:
        a timezone registry