biweekly.io.json
Class JCalRawReader

java.lang.Object
  extended by biweekly.io.json.JCalRawReader
All Implemented Interfaces:
Closeable

public class JCalRawReader
extends Object
implements Closeable

Parses an iCalendar JSON data stream (jCal).

Author:
Michael Angstadt
See Also:
jCal draft

Nested Class Summary
static interface JCalRawReader.JCalDataStreamListener
          Handles the iCalendar data as it is read off the data stream.
 
Constructor Summary
JCalRawReader(Reader reader)
          Creates a new reader.
 
Method Summary
 void close()
          Closes the underlying Reader object.
 boolean eof()
          Determines whether the end of the data stream has been reached.
 int getLineNum()
          Gets the current line number.
 void readNext(JCalRawReader.JCalDataStreamListener listener)
          Reads the next iCalendar object from the jCal data stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCalRawReader

public JCalRawReader(Reader reader)
Creates a new reader.

Parameters:
reader - the reader to the data stream
Method Detail

getLineNum

public int getLineNum()
Gets the current line number.

Returns:
the line number

readNext

public void readNext(JCalRawReader.JCalDataStreamListener listener)
              throws IOException
Reads the next iCalendar object from the jCal data stream.

Parameters:
listener - handles the iCalendar data as it is read off the wire
Throws:
JCalParseException - if the jCal syntax is incorrect (the JSON syntax may be valid, but it is not in the correct jCal format).
JsonParseException - if the JSON syntax is incorrect
IOException - if there is a problem reading from the data stream

eof

public boolean eof()
Determines whether the end of the data stream has been reached.

Returns:
true if the end has been reached, false if not

close

public void close()
           throws IOException
Closes the underlying Reader object.

Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2013 Michael Angstadt. All Rights Reserved.