ezvcard.io.json
Class JCardRawReader

java.lang.Object
  extended by ezvcard.io.json.JCardRawReader
All Implemented Interfaces:
Closeable

public class JCardRawReader
extends Object
implements Closeable

Parses an vCard JSON data stream (jCard).

Author:
Michael Angstadt
See Also:
jCard draft

Nested Class Summary
static interface JCardRawReader.JCardDataStreamListener
          Handles the vCard data as it is read off the data stream.
 
Constructor Summary
JCardRawReader(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(JCardRawReader.JCardDataStreamListener listener)
          Reads the next vCard from the jCard data stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCardRawReader

public JCardRawReader(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(JCardRawReader.JCardDataStreamListener listener)
              throws IOException
Reads the next vCard from the jCard data stream.

Parameters:
listener - handles the vCard data as it is read off the wire
Throws:
JCardParseException - if the jCard syntax is incorrect (the JSON syntax may be valid, but it is not in the correct jCard 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 © 2012-2014 Michael Angstadt. All Rights Reserved.