cc.plural.jsonij
Class StringJSONReader

java.lang.Object
  extended by cc.plural.jsonij.parser.BaseReaderParser
      extended by cc.plural.jsonij.JSONReader
          extended by cc.plural.jsonij.StringJSONReader
All Implemented Interfaces:
ReaderParser

public class StringJSONReader
extends JSONReader

java.lang.String implementation of a JSONReader.

Author:
J.W.Marsden

Nested Class Summary
protected  class StringJSONReader.StringJSONStringReader
           
 
Field Summary
protected  int index
           
protected  String jsonString
           
protected  int length
           
protected  StringJSONReader.StringJSONStringReader stringReader
           
 
Fields inherited from class cc.plural.jsonij.parser.BaseReaderParser
hasPeeked, peekValue, position
 
Constructor Summary
StringJSONReader(String jsonString)
           
StringJSONReader(String jsonString, int index)
           
 
Method Summary
 int getIndex()
           
 ReaderParser getStringReader()
           
 int readNext()
          Reads from the reader.
 
Methods inherited from class cc.plural.jsonij.parser.BaseReaderParser
close, getLineNumber, getPosition, getPositionNumber, handleNewLine, hasPeeked, isHasPeeked, peek, read, setHasPeeked, setPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cc.plural.jsonij.parser.ReaderParser
close, getLineNumber, getPosition, getPositionNumber, hasPeeked, isHasPeeked, peek, read, setHasPeeked
 

Field Detail

jsonString

protected final String jsonString

index

protected int index

length

protected final int length

stringReader

protected final StringJSONReader.StringJSONStringReader stringReader
Constructor Detail

StringJSONReader

public StringJSONReader(String jsonString)

StringJSONReader

public StringJSONReader(String jsonString,
                        int index)
Method Detail

readNext

public int readNext()
             throws IOException,
                    ParserException
Description copied from class: BaseReaderParser
Reads from the reader.

Specified by:
readNext in class BaseReaderParser
Returns:
The read byte if found otherwise -1 if the end of the stream is reached.
Throws:
IOException - Java IO Exception.
ParserException

getIndex

public int getIndex()

getStringReader

public ReaderParser getStringReader()
Specified by:
getStringReader in class JSONReader


Copyright © 2012. All Rights Reserved.