Top Description Inners Fields Constructors Methods
net.fortuna.ical4j.data

public Class CalendarParserImpl

extends Object
implements CalendarParser
Class Inheritance
All Implemented Interfaces
net.fortuna.ical4j.data.CalendarParser
Imports
net.fortuna.ical4j.model.Calendar, .Component, net.fortuna.ical4j.util.CompatibilityHints, org.slf4j.Logger, .LoggerFactory, java.io.*, java.net.URISyntaxException, java.text.MessageFormat

$Id$

 Created [Nov 5, 2004]

The default implementation of a calendar parser.

Author
Ben Fortuna

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
CalendarParserImpl.ComponentListParser

Parses an iCalendar component list from the specified stream tokeniser.

private class
CalendarParserImpl.ComponentParser

Parses an iCalendar component from the specified stream tokeniser.

private class
CalendarParserImpl.ParameterListParser

Parses a list of iCalendar parameters by parsing the specified stream tokeniser.

private class
private class
CalendarParserImpl.PropertyListParser

Parses an iCalendar property list from the specified stream tokeniser.

private class
CalendarParserImpl.PropertyParser

Parses an iCalendar property from the specified stream tokeniser.

Field Summary

Modifier and TypeField and Description
private final boolean
private final CalendarParserImpl.ComponentListParser
private final CalendarParserImpl.ComponentParser
private static final int
private final Logger
private final CalendarParserImpl.ParameterListParser
private final CalendarParserImpl.ParameterParser
private final CalendarParserImpl.PropertyListParser
private final CalendarParserImpl.PropertyParser
private static final String
private static final int
private static final int
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
public
public
CalendarParserImpl(boolean absorbWhitespaceEnabled)

Method Summary

Modifier and TypeMethod and Description
private void

Returns:

int value of the ttype field of the tokeniser
absorbWhitespace
(final StreamTokenizer tokeniser, Reader in)

Absorbs extraneous newlines.

private int

Returns:

int value of the ttype field of the tokeniser
assertToken
(final StreamTokenizer
stream tokeniser to perform assertion on
tokeniser
,
Reader in, final int
expected token
token
)

Asserts that the next token in the stream matches the specified token.

private int

Returns:

int value of the ttype field of the tokeniser
assertToken
(final StreamTokenizer tokeniser, Reader in, final String token)

Asserts that the next token in the stream matches the specified token.

private int

Returns:

int value of the ttype field of the tokeniser
assertToken
(final StreamTokenizer
stream tokeniser to perform assertion on
tokeniser
,
Reader in, final String
expected token
token
,
final boolean ignoreCase, final boolean isBeginToken)

Asserts that the next token in the stream matches the specified token.

private int

Returns:

int value of the ttype field of the tokeniser
getLineNumber
(StreamTokenizer tokeniser, Reader in)

private String
getSvalIgnoringBom(StreamTokenizer tokeniser, Reader in, String token)

Ignore BOM character.

private int

Returns:

int value of the ttype field of the tokeniser
nextToken
(StreamTokenizer tokeniser, Reader in)

private int

Returns:

int value of the ttype field of the tokeniser
nextToken
(StreamTokenizer tokeniser, Reader in, boolean ignoreEOF)

Reads the next token from the tokeniser.

public final void
parse(final InputStream
an input stream from which to read iCalendar data
in
,
final ContentHandler
the content handler to notify during parsing
handler
)

Implements net.fortuna.ical4j.data.CalendarParser.parse.

Parse the iCalendar data from the specified input stream.

public final void
parse(final Reader
a reader from which to read iCalendar data
in
,
final ContentHandler
the content handler to notify during parsing
handler
)

Implements net.fortuna.ical4j.data.CalendarParser.parse.

Parse the iCalendar data from the specified reader.

private void
parseCalendar(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler)

Parses an iCalendar VCALENDAR from the specified stream tokeniser.

private void
parseCalendarList(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler)

Parses multiple VCALENDARs from the specified stream tokeniser.

private int

Returns:

int value of the ttype field of the tokeniser
skipNewLines
(StreamTokenizer tokeniser, Reader in, String token)

Skip newlines and linefeed at the beginning.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

absorbWhitespaceEnabledback to summary
private final boolean absorbWhitespaceEnabled
componentListParserback to summary
private final CalendarParserImpl.ComponentListParser componentListParser
componentParserback to summary
private final CalendarParserImpl.ComponentParser componentParser
IGNORE_BEGINNING_NON_WORD_COUNTback to summary
private static final int IGNORE_BEGINNING_NON_WORD_COUNT
logback to summary
private final Logger log
paramListParserback to summary
private final CalendarParserImpl.ParameterListParser paramListParser
paramParserback to summary
private final CalendarParserImpl.ParameterParser paramParser
propertyListParserback to summary
private final CalendarParserImpl.PropertyListParser propertyListParser
propertyParserback to summary
private final CalendarParserImpl.PropertyParser propertyParser
UNEXPECTED_TOKEN_MESSAGEback to summary
private static final String UNEXPECTED_TOKEN_MESSAGE
WHITESPACE_CHAR_ENDback to summary
private static final int WHITESPACE_CHAR_END
WHITESPACE_CHAR_STARTback to summary
private static final int WHITESPACE_CHAR_START
WORD_CHAR_ENDback to summary
private static final int WORD_CHAR_END
WORD_CHAR_STARTback to summary
private static final int WORD_CHAR_START

Constructor Detail

CalendarParserImplback to summary
public CalendarParserImpl()
CalendarParserImplback to summary
public CalendarParserImpl(boolean absorbWhitespaceEnabled)

Method Detail

absorbWhitespaceback to summary
private void absorbWhitespace(final StreamTokenizer tokeniser, Reader in) throws IOException, ParserException

Absorbs extraneous newlines.

Returns:void

int value of the ttype field of the tokeniser

assertTokenback to summary
private int assertToken(final StreamTokenizer tokeniser, Reader in, final int token) throws IOException, ParserException

Asserts that the next token in the stream matches the specified token.

Parameters
tokeniser:StreamTokenizer

stream tokeniser to perform assertion on

token:int

expected token

Returns:int

int value of the ttype field of the tokeniser

Exceptions
IOException:
when unable to read from stream
ParserException:
when next token in the stream does not match the expected token
assertTokenback to summary
private int assertToken(final StreamTokenizer tokeniser, Reader in, final String token) throws IOException, ParserException

Asserts that the next token in the stream matches the specified token. This method is case-sensitive.

Returns:int

int value of the ttype field of the tokeniser

assertTokenback to summary
private int assertToken(final StreamTokenizer tokeniser, Reader in, final String token, final boolean ignoreCase, final boolean isBeginToken) throws IOException, ParserException

Asserts that the next token in the stream matches the specified token.

Parameters
tokeniser:StreamTokenizer

stream tokeniser to perform assertion on

token:String

expected token

Returns:int

int value of the ttype field of the tokeniser

Exceptions
IOException:
when unable to read from stream
ParserException:
when next token in the stream does not match the expected token
getLineNumberback to summary
private int getLineNumber(StreamTokenizer tokeniser, Reader in)
Returns:int

int value of the ttype field of the tokeniser

getSvalIgnoringBomback to summary
private String getSvalIgnoringBom(StreamTokenizer tokeniser, Reader in, String token)

Ignore BOM character.

nextTokenback to summary
private int nextToken(StreamTokenizer tokeniser, Reader in) throws IOException, ParserException
Returns:int

int value of the ttype field of the tokeniser

nextTokenback to summary
private int nextToken(StreamTokenizer tokeniser, Reader in, boolean ignoreEOF) throws IOException, ParserException

Reads the next token from the tokeniser. This method throws a ParserException when reading EOF.

Returns:int

int value of the ttype field of the tokeniser

Exceptions
ParserException:
When reading EOF.
parseback to summary
public final void parse(final InputStream in, final ContentHandler handler) throws IOException, ParserException

Implements net.fortuna.ical4j.data.CalendarParser.parse.

Doc from net.fortuna.ical4j.data.CalendarParser.parse.

Parse the iCalendar data from the specified input stream.

Parameters
in:InputStream

an input stream from which to read iCalendar data

handler:ContentHandler

the content handler to notify during parsing

Annotations
@Override
Exceptions
IOException:
thrown when unable to read from the specified stream
ParserException:
thrown if an error occurs during parsing
parseback to summary
public final void parse(final Reader in, final ContentHandler handler) throws IOException, ParserException

Implements net.fortuna.ical4j.data.CalendarParser.parse.

Doc from net.fortuna.ical4j.data.CalendarParser.parse.

Parse the iCalendar data from the specified reader.

Parameters
in:Reader

a reader from which to read iCalendar data

handler:ContentHandler

the content handler to notify during parsing

Annotations
@Override
Exceptions
IOException:
thrown when unable to read from the specified reader
ParserException:
thrown if an error occurs during parsing
parseCalendarback to summary
private void parseCalendar(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler) throws IOException, URISyntaxException, ParserException

Parses an iCalendar VCALENDAR from the specified stream tokeniser.

parseCalendarListback to summary
private void parseCalendarList(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler) throws IOException, URISyntaxException, ParserException

Parses multiple VCALENDARs from the specified stream tokeniser.

skipNewLinesback to summary
private int skipNewLines(StreamTokenizer tokeniser, Reader in, String token) throws ParserException, IOException

Skip newlines and linefeed at the beginning.

Returns:int

int value of the ttype field of the tokeniser

net.fortuna.ical4j.data back to summary

private Class CalendarParserImpl.ComponentListParser

extends Object
Class Inheritance
  • java.lang.Object
  • net.fortuna.ical4j.data.CalendarParserImpl.ComponentListParser

Parses an iCalendar component list from the specified stream tokeniser.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
parse(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ComponentListParserback to summary
private ComponentListParser()

Method Detail

parseback to summary
private void parse(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler) throws IOException, URISyntaxException, ParserException
net.fortuna.ical4j.data back to summary

private Class CalendarParserImpl.ComponentParser

extends Object
Class Inheritance

Parses an iCalendar component from the specified stream tokeniser.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
parse(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ComponentParserback to summary
private ComponentParser()

Method Detail

parseback to summary
private void parse(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler) throws IOException, URISyntaxException, ParserException
net.fortuna.ical4j.data back to summary

private Class CalendarParserImpl.ParameterListParser

extends Object
Class Inheritance
  • java.lang.Object
  • net.fortuna.ical4j.data.CalendarParserImpl.ParameterListParser

Parses a list of iCalendar parameters by parsing the specified stream tokeniser.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
parse(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ParameterListParserback to summary
private ParameterListParser()

Method Detail

parseback to summary
public void parse(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler) throws IOException, ParserException, URISyntaxException
net.fortuna.ical4j.data back to summary

private Class CalendarParserImpl.ParameterParser

extends Object
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
parse(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ParameterParserback to summary
private ParameterParser()

Method Detail

parseback to summary
private void parse(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler) throws IOException, ParserException, URISyntaxException
net.fortuna.ical4j.data back to summary

private Class CalendarParserImpl.PropertyListParser

extends Object
Class Inheritance
  • java.lang.Object
  • net.fortuna.ical4j.data.CalendarParserImpl.PropertyListParser

Parses an iCalendar property list from the specified stream tokeniser.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
parse(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PropertyListParserback to summary
private PropertyListParser()

Method Detail

parseback to summary
public void parse(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler) throws IOException, URISyntaxException, ParserException
net.fortuna.ical4j.data back to summary

private Class CalendarParserImpl.PropertyParser

extends Object
Class Inheritance

Parses an iCalendar property from the specified stream tokeniser.

Field Summary

Modifier and TypeField and Description
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
parse(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

PARSE_DEBUG_MESSAGEback to summary
private static final String PARSE_DEBUG_MESSAGE
PARSE_EXCEPTION_MESSAGEback to summary
private static final String PARSE_EXCEPTION_MESSAGE

Constructor Detail

PropertyParserback to summary
private PropertyParser()

Method Detail

parseback to summary
private void parse(final StreamTokenizer tokeniser, Reader in, final ContentHandler handler) throws IOException, ParserException, URISyntaxException