edu.cmu.andrew.icalendar
Class VCalendarParser

java.lang.Object
  |
  +--edu.cmu.andrew.icalendar.VCalendarParser

public class VCalendarParser
extends Object

Turn streams into ICalendarObjects.


Field Summary
(package private)  int nextchar
           
 
Constructor Summary
private VCalendarParser()
           
 
Method Summary
private static boolean checkString(BufferedReader r, String s)
           
private static boolean eatString(BufferedReader r, String s)
          Consumes the string s from the BufferedReader.
static VCalendar parse(BufferedReader r)
          Constructs a VCalendar from the input stream
static Component parseArbitraryComponent(BufferedReader r)
          Constructs any valid iCalendar component from the input stream.
private  Component parseComponent(BufferedReader r)
          given a stream at "BEGIN:", produce an object of that component
private  Parameter parseParameter(BufferedReader r)
           
private  Property parseProperty(BufferedReader r)
          given a stream at the start of a property line, parse the property.
static Map parsePropertyList(Map propmap, BufferedReader r)
           
private static int peekChar(BufferedReader r)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

nextchar

int nextchar
Constructor Detail

VCalendarParser

private VCalendarParser()
Method Detail

peekChar

private static int peekChar(BufferedReader r)
                     throws IOException

checkString

private static boolean checkString(BufferedReader r,
                                   String s)
                            throws IOException

eatString

private static boolean eatString(BufferedReader r,
                                 String s)
                          throws IOException
Consumes the string s from the BufferedReader. Consumes no input if s does not match the start of the stream.
Parameters:
r -  
s -  
Returns:
true if the input was consumed
Throws:
IOException -  

parseParameter

private Parameter parseParameter(BufferedReader r)
                          throws ICalendarParseException,
                                 IOException

parseProperty

private Property parseProperty(BufferedReader r)
                        throws ICalendarParseException,
                               IOException,
                               BadComponentException
given a stream at the start of a property line, parse the property.

parseComponent

private Component parseComponent(BufferedReader r)
                          throws ICalendarParseException,
                                 BadComponentException,
                                 IOException
given a stream at "BEGIN:", produce an object of that component

parseArbitraryComponent

public static Component parseArbitraryComponent(BufferedReader r)
                                         throws ICalendarParseException,
                                                BadComponentException
Constructs any valid iCalendar component from the input stream.
Parameters:
r - the input stream
Returns:
a newly constructed component
Throws:
ICalendarParseException -  
BadComponentException -  

parse

public static VCalendar parse(BufferedReader r)
                       throws ICalendarParseException,
                              BadComponentException
Constructs a VCalendar from the input stream
Parameters:
s - the input stream
Returns:
a newly created VCalendar object
Throws:
ICalendarParseException - when the stream doesn't have ICalendar syntax
BadComponentException - when the stream contains a component that violates an invariant

parsePropertyList

public static Map parsePropertyList(Map propmap,
                                    BufferedReader r)
                             throws ICalendarParseException,
                                    BadComponentException