cc.plural.jsonij.parser
Class BaseReaderParser
java.lang.Object
cc.plural.jsonij.parser.BaseReaderParser
- All Implemented Interfaces:
- ReaderParser
- Direct Known Subclasses:
- JPathParser.JPathReader, JSONReader
public abstract class BaseReaderParser
- extends Object
- implements ReaderParser
- Author:
- openecho
peekValue
protected int peekValue
hasPeeked
protected boolean hasPeeked
position
protected Position position
BaseReaderParser
public BaseReaderParser()
BaseReaderParser
public BaseReaderParser(Reader reader)
getPosition
public Position getPosition()
- Specified by:
getPosition in interface ReaderParser
- Returns:
- the position
setPosition
protected Position setPosition(Position position)
- Parameters:
position - the position to set
isHasPeeked
public boolean isHasPeeked()
- Only here for POJO reasons.
- Specified by:
isHasPeeked in interface ReaderParser
- Returns:
- hasPeeked()
- See Also:
hasPeeked()
hasPeeked
public boolean hasPeeked()
- Specified by:
hasPeeked in interface ReaderParser
setHasPeeked
public void setHasPeeked(boolean hasPeeked)
- Specified by:
setHasPeeked in interface ReaderParser
getLineNumber
public int getLineNumber()
- Specified by:
getLineNumber in interface ReaderParser
getPositionNumber
public int getPositionNumber()
- Specified by:
getPositionNumber in interface ReaderParser
peek
public int peek()
throws IOException,
ParserException
- Specified by:
peek in interface ReaderParser
- Throws:
IOException
ParserException
read
public int read()
throws IOException,
ParserException
- Specified by:
read in interface ReaderParser
- Throws:
IOException
ParserException
readNext
protected abstract int readNext()
throws IOException,
ParserException
- Reads from the reader.
- Parameters:
targetReader - The reader to be read from.
- Returns:
- The read byte if found otherwise -1 if the end of the stream is reached.
- Throws:
IOException - Java IO Exception.
ParserException
close
public void close()
- Specified by:
close in interface ReaderParser
handleNewLine
protected void handleNewLine()
throws IOException
- Throws:
IOException
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2012. All Rights Reserved.