|
JSON Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jackson.JsonParser
org.codehaus.jackson.impl.ReaderBasedParserBase
public abstract class ReaderBasedParserBase
This is a simple low-level input reader base class, used by JSON parser. The reason for sub-classing (over composition) is due to need for direct access to character buffers and positions.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.codehaus.jackson.JsonParser |
---|
JsonParser.NumberType |
Field Summary | |
---|---|
protected long |
mCurrInputProcessed
Number of characters that were contained in previous blocks (blocks that were already processed prior to the current buffer). |
protected int |
mCurrInputRow
Current row location of current point in input buffer, starting from 1 |
protected int |
mCurrInputRowStart
Current index of the first character of the current row in input buffer. |
protected JsonToken |
mCurrToken
|
protected char[] |
mInputBuffer
Current buffer from which data is read; generally data is read into buffer from input source, but not always (especially when using nested input contexts when expanding parsed entity references etc). |
protected int |
mInputLen
Index of character after last available one in the buffer. |
protected int |
mInputPtr
Pointer to next available character in buffer |
protected IOContext |
mIOContext
I/O context for this reader. |
protected Reader |
mReader
Reader that can be used for reading more content, if one in use. |
protected TextBuffer |
mTextBuffer
Buffer that contains contents of String values, including field names if necessary (name split across boundary, contains escape sequence, or access needed to char array) |
protected int |
mTokenInputCol
Column on input row that current token starts; 0-based (although in the end it'll be converted to 1-based) |
protected int |
mTokenInputRow
Input row on which current token starts, 1-based |
protected long |
mTokenInputTotal
Total number of characters read before start of current token. |
Constructor Summary | |
---|---|
protected |
ReaderBasedParserBase(IOContext ctxt,
Reader r)
|
Method Summary | |
---|---|
protected void |
closeReader()
|
protected static String |
getCharDesc(int ch)
|
abstract JsonLocation |
getCurrentLocation()
Method that returns location of the last processed character; usually for error reporting purposes. |
protected char |
getNextChar(String eofMsg)
|
long |
getTokenCharacterOffset()
|
int |
getTokenColumnNr()
|
int |
getTokenLineNr()
|
protected boolean |
loadMore()
|
protected void |
markLF()
|
protected void |
markLF(int inputPtr)
|
protected void |
releaseBuffers()
Method called to release internal buffers owned by the base reader. |
protected void |
reportError(String msg)
|
protected void |
reportInvalidEOF(String msg)
|
protected void |
reportUnexpectedChar(int ch,
String comment)
|
protected void |
skipCR()
|
protected void |
skipLF()
|
protected void |
throwInternal()
|
protected void |
wrapError(String msg,
Throwable t)
|
Methods inherited from class org.codehaus.jackson.JsonParser |
---|
close, getCurrentName, getCurrentToken, getDecimalValue, getDoubleValue, getIntValue, getLongValue, getNumberType, getNumberValue, getParsingContext, getText, getTextCharacters, getTextLength, getTextOffset, getTokenLocation, hasCurrentToken, nextToken |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final IOContext mIOContext
protected Reader mReader
protected JsonToken mCurrToken
protected char[] mInputBuffer
protected int mInputPtr
protected int mInputLen
protected long mCurrInputProcessed
protected int mCurrInputRow
protected int mCurrInputRowStart
protected long mTokenInputTotal
protected int mTokenInputRow
protected int mTokenInputCol
protected final TextBuffer mTextBuffer
Constructor Detail |
---|
protected ReaderBasedParserBase(IOContext ctxt, Reader r)
Method Detail |
---|
public final long getTokenCharacterOffset()
public final int getTokenLineNr()
public final int getTokenColumnNr()
protected final void skipCR() throws IOException
IOException
protected final void skipLF() throws IOException
IOException
protected final void markLF()
protected final void markLF(int inputPtr)
protected final boolean loadMore() throws IOException
IOException
protected char getNextChar(String eofMsg) throws IOException, JsonParseException
IOException
JsonParseException
protected void closeReader() throws IOException
IOException
protected void releaseBuffers() throws IOException
closeReader()
(for
example, when explicitly closing this reader instance), or
separately (if need be).
IOException
public abstract JsonLocation getCurrentLocation()
JsonParser
getCurrentLocation
in class JsonParser
protected static String getCharDesc(int ch)
protected void reportUnexpectedChar(int ch, String comment) throws JsonParseException
JsonParseException
protected void reportInvalidEOF(String msg) throws JsonParseException
JsonParseException
protected void reportError(String msg) throws JsonParseException
JsonParseException
protected void wrapError(String msg, Throwable t) throws JsonParseException
JsonParseException
protected void throwInternal()
|
JSON Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |