java.lang.Object
net.fortuna.ical4j.data.CalendarBuilder
Parses and builds an iCalendar model from an input stream. Note that this class is not thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.CalendarBuilder(CalendarParser parser) Constructs a new calendar builder using the specified calendar parser.CalendarBuilder(CalendarParser parser, Supplier<List<ParameterFactory<?>>> parameterFactorySupplier, Supplier<List<PropertyFactory<?>>> propertyFactorySupplier, Supplier<List<ComponentFactory<?>>> componentFactorySupplier, TimeZoneRegistry tzRegistry) Deprecated.CalendarBuilder(CalendarParser parser, ContentHandlerContext contentHandlerContext, TimeZoneRegistry tzRegistry) CalendarBuilder(CalendarParser parser, PropertyFactoryRegistry propertyFactoryRegistry, ParameterFactoryRegistry parameterFactoryRegistry, TimeZoneRegistry tzRegistry) Deprecated.CalendarBuilder(CalendarParser parser, TimeZoneRegistry tzRegistry) Constructs a new instance using the specified parser and registry.CalendarBuilder(TimeZoneRegistry tzRegistry) Constructs a new calendar builder using the specified timezone registry. -
Method Summary
Modifier and TypeMethodDescriptionbuild(InputStream in) Builds an iCalendar model from the specified input stream.Builds an iCalendar model from the specified reader.build(UnfoldingReader uin) Build an iCalendar model by parsing data from the specified reader.final TimeZoneRegistryReturns the timezone registry used in the construction of calendars.
-
Constructor Details
-
CalendarBuilder
public CalendarBuilder()Default constructor. -
CalendarBuilder
Constructs a new calendar builder using the specified calendar parser.- Parameters:
parser- a calendar parser used to parse calendar files
-
CalendarBuilder
Constructs a new calendar builder using the specified timezone registry.- Parameters:
tzRegistry- a timezone registry to populate with discovered timezones
-
CalendarBuilder
Constructs a new instance using the specified parser and registry.- Parameters:
parser- a calendar parser used to construct the calendartzRegistry- a timezone registry used to retrieveTimeZones and register additional timezone information found in the calendar
-
CalendarBuilder
@Deprecated public CalendarBuilder(CalendarParser parser, PropertyFactoryRegistry propertyFactoryRegistry, ParameterFactoryRegistry parameterFactoryRegistry, TimeZoneRegistry tzRegistry) Deprecated.- Parameters:
parser- a custom calendar parsertzRegistry- a custom timezone registry
-
CalendarBuilder
@Deprecated public CalendarBuilder(CalendarParser parser, Supplier<List<ParameterFactory<?>>> parameterFactorySupplier, Supplier<List<PropertyFactory<?>>> propertyFactorySupplier, Supplier<List<ComponentFactory<?>>> componentFactorySupplier, TimeZoneRegistry tzRegistry) - Parameters:
parser- a custom calendar parsertzRegistry- a custom timezone registry
-
CalendarBuilder
public CalendarBuilder(CalendarParser parser, ContentHandlerContext contentHandlerContext, TimeZoneRegistry tzRegistry) - Parameters:
parser- a custom calendar parsertzRegistry- a custom timezone registry
-
-
Method Details
-
build
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 streamParserException- where an error occurs parsing data from the stream
-
build
Builds an iCalendar model from the specified reader. AnUnfoldingReaderis 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 readerParserException- where an error occurs parsing data from the reader
-
build
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 readerParserException- where an error occurs parsing data from the reader
-
getRegistry
Returns the timezone registry used in the construction of calendars.- Returns:
- a timezone registry
-
CalendarBuilder(CalendarParser,ContentHandlerContext, TimeZoneRegistry)