com.ibm.portal.streaming.json
Class JsonParserReader

java.lang.Object
  extended by java.io.Reader
      extended by com.ibm.portal.streaming.json.JsonParserReader
All Implemented Interfaces:
JsonStream, Streamable, Writable, java.io.Closeable, java.lang.Readable, java.nio.channels.Channel

public abstract class JsonParserReader
extends java.io.Reader
implements Writable, Streamable, java.nio.channels.Channel, JsonStream

Implementation of a pull parser to decode JSON data as defined in RFC 4627. The JSON object will be represented as a sequence of JsonParserReader.Entry objects (similar to the concept of the ZipInputStream). Each JsonParserReader.Entry denotes a syntactical entity of the JSON object, e.g. the start or end of an object, an array or a value. Depending on the type of the entry the content can be accessed via the DataInput interface or as a character stream via the Reader interface on either the entry or the parser.

Since:
7.0.0.1

Nested Class Summary
static class JsonParserReader.Entry
          Represents an entry in this input stream.
static class JsonParserReader.TYPE
          Type of the next entry
 
Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Fields inherited from interface com.ibm.portal.streaming.json.JsonStream
CONTENT_TYPE_JSON
 
Constructor Summary
JsonParserReader()
           
 
Method Summary
abstract  void closeEntry()
          Closes the entry and positions the stream for the next entry
abstract  JsonParserReader.Entry getNextEntry()
          Returns the next entry and closes a previous entry if required
 
Methods inherited from class java.io.Reader
close, mark, markSupported, read, read, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.utilities.streams.Writable
write
 
Methods inherited from interface com.ibm.utilities.streams.Streamable
write
 
Methods inherited from interface java.nio.channels.Channel
close, isOpen
 

Constructor Detail

JsonParserReader

public JsonParserReader()
Method Detail

closeEntry

public abstract void closeEntry()
                         throws java.io.IOException
Closes the entry and positions the stream for the next entry

Throws:
java.io.IOException - if an I/O error has occurred

getNextEntry

public abstract JsonParserReader.Entry getNextEntry()
                                             throws java.io.IOException
Returns the next entry and closes a previous entry if required

Returns:
the next entry or null if no next entry exists
Throws:
java.io.IOException - if an I/O error has occurred