net.fortuna.ical4j.data

Class CalendarBuilder

Implemented Interfaces:
ContentHandler

public class CalendarBuilder
extends java.lang.Object
implements ContentHandler

$Id: CalendarBuilder.java,v 1.34 2008/12/16 12:34:54 fortuna Exp $ Created: Apr 5, 2004 Parses and builds an iCalendar model from an input stream. Note that this class is not thread-safe.

Field Summary

protected Calendar
calendar
protected Component
component
protected ArrayList
datesMissingTimezones
protected Property
property
protected Component
subComponent

Constructor Summary

CalendarBuilder()
Default constructor.
CalendarBuilder(CalendarParser parser)
Constructs a new calendar builder using the specified calendar parser.
CalendarBuilder(CalendarParser parser, TimeZoneRegistry registry)
Constructs a new instance using the specified parser and registry.
CalendarBuilder(TimeZoneRegistry registry)
Constructs a new calendar builder using the specified timezone registry.

Method Summary

Calendar
build(InputStream in)
Builds an iCalendar model from the specified input stream.
Calendar
build(Reader in)
Builds an iCalendar model from the specified reader.
Calendar
build(UnfoldingReader uin)
Build an iCalendar model by parsing data from the specified reader.
void
endCalendar()
void
endComponent(String name)
void
endProperty(String name)
TimeZoneRegistry
getRegistry()
Returns the timezone registry used in the construction of calendars.
void
parameter(String name, String value)
void
propertyValue(String value)
void
startCalendar()
void
startComponent(String name)
void
startProperty(String name)

Field Details

calendar

protected Calendar calendar

component

protected Component component

datesMissingTimezones

protected ArrayList datesMissingTimezones

property

protected Property property

subComponent

protected Component subComponent

Constructor Details

CalendarBuilder

public CalendarBuilder()
Default constructor.

CalendarBuilder

public CalendarBuilder(CalendarParser parser)
Constructs a new calendar builder using the specified calendar parser.
Parameters:
parser - a calendar parser used to parse calendar files

CalendarBuilder

public CalendarBuilder(CalendarParser parser,
                       TimeZoneRegistry registry)
Constructs a new instance using the specified parser and registry.
Parameters:
parser - a calendar parser used to construct the calendar
registry - a timezone registry used to retrieve TimeZones and register additional timezone information found in the calendar

CalendarBuilder

public CalendarBuilder(TimeZoneRegistry registry)
Constructs a new calendar builder using the specified timezone registry.
Parameters:

Method Details

build

public Calendar build(InputStream in)
            throws IOException,
                   ParserException
Builds an iCalendar model from the specified input stream.
Parameters:
in -
Returns:
a calendar

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 -
Returns:
a calendar

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 model

endCalendar

public void endCalendar()

endComponent

public void endComponent(String name)

endProperty

public void endProperty(String name)

getRegistry

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

parameter

public void parameter(String name,
                      String value)
            throws URISyntaxException

propertyValue

public void propertyValue(String value)
            throws URISyntaxException,
                   ParseException,
                   IOException

startCalendar

public void startCalendar()

startComponent

public void startComponent(String name)

startProperty

public void startProperty(String name)