|
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
org.codehaus.jackson.impl.ReaderBasedNumericParser
public abstract class ReaderBasedNumericParser
Intermediate class that implements handling of numeric parsing. Separate from the actual parser class just to isolate numeric parsing: would be nice to use aggregation, but unfortunately many parts are hard to implement without direct access to underlying buffers.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.codehaus.jackson.JsonParser |
---|
JsonParser.NumberType |
Field Summary | |
---|---|
protected static char |
CHAR_NULL
|
protected static int |
INT_0
|
protected static int |
INT_1
|
protected static int |
INT_2
|
protected static int |
INT_3
|
protected static int |
INT_4
|
protected static int |
INT_5
|
protected static int |
INT_6
|
protected static int |
INT_7
|
protected static int |
INT_8
|
protected static int |
INT_9
|
protected static int |
INT_DECIMAL_POINT
|
protected static int |
INT_e
|
protected static int |
INT_E
|
protected static int |
INT_MINUS
|
protected static int |
INT_PLUS
|
protected int |
mExpLength
Length of the exponent part of the number, if any, not including 'e' marker or sign, just digits. |
protected int |
mFractLength
Length of the fractional part (not including decimal point or exponent), in characters. |
protected int |
mIntLength
Length of integer part of the number, in characters |
protected BigDecimal |
mNumberBigDecimal
|
protected BigInteger |
mNumberBigInt
|
protected double |
mNumberDouble
|
protected int |
mNumberInt
|
protected long |
mNumberLong
|
protected boolean |
mNumberNegative
Flag that indicates whether numeric value has a negative value. |
protected int |
mNumTypesValid
Bitfield that indicates which numeric representations have been calculated for the current type |
protected static int |
NR_BIGDECIMAL
|
protected static int |
NR_BIGINT
|
protected static int |
NR_DOUBLE
|
protected static int |
NR_INT
|
protected static int |
NR_LONG
|
Fields inherited from class org.codehaus.jackson.impl.ReaderBasedParserBase |
---|
mCurrInputProcessed, mCurrInputRow, mCurrInputRowStart, mCurrToken, mInputBuffer, mInputLen, mInputPtr, mIOContext, mReader, mTextBuffer, mTokenInputCol, mTokenInputRow, mTokenInputTotal |
Constructor Summary | |
---|---|
ReaderBasedNumericParser(IOContext pc,
Reader r)
|
Method Summary | |
---|---|
protected void |
convertNumberToBigDecimal()
|
protected void |
convertNumberToDouble()
|
protected void |
convertNumberToInt()
|
protected void |
convertNumberToLong()
|
abstract String |
getText()
Method for accessing textual representation of the current event; if no current event (before first call to JsonParser.nextToken() , or
after encountering end-of-input), returns null. |
protected JsonToken |
parseNumberText(int ch)
Initial parsing method for number values. |
protected void |
parseNumericValue()
Method that will parse actual numeric value out of a syntactically valid number value. |
protected void |
reportInvalidNumber(String msg)
|
protected void |
reportOverflowInt()
|
protected void |
reportOverflowLong()
|
protected void |
reportUnexpectedNumberChar(int ch,
String comment)
|
Methods inherited from class org.codehaus.jackson.impl.ReaderBasedParserBase |
---|
closeReader, getCharDesc, getCurrentLocation, getNextChar, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, loadMore, markLF, markLF, releaseBuffers, reportError, reportInvalidEOF, reportUnexpectedChar, skipCR, skipLF, throwInternal, wrapError |
Methods inherited from class org.codehaus.jackson.JsonParser |
---|
close, getCurrentName, getCurrentToken, getDecimalValue, getDoubleValue, getIntValue, getLongValue, getNumberType, getNumberValue, getParsingContext, 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 static final int NR_INT
protected static final int NR_LONG
protected static final int NR_BIGINT
protected static final int NR_DOUBLE
protected static final int NR_BIGDECIMAL
protected static final int INT_0
protected static final int INT_1
protected static final int INT_2
protected static final int INT_3
protected static final int INT_4
protected static final int INT_5
protected static final int INT_6
protected static final int INT_7
protected static final int INT_8
protected static final int INT_9
protected static final int INT_MINUS
protected static final int INT_PLUS
protected static final int INT_DECIMAL_POINT
protected static final int INT_e
protected static final int INT_E
protected static final char CHAR_NULL
protected int mNumTypesValid
protected int mNumberInt
protected long mNumberLong
protected double mNumberDouble
protected BigInteger mNumberBigInt
protected BigDecimal mNumberBigDecimal
protected boolean mNumberNegative
protected int mIntLength
protected int mFractLength
protected int mExpLength
Constructor Detail |
---|
public ReaderBasedNumericParser(IOContext pc, Reader r)
Method Detail |
---|
public abstract String getText() throws IOException, JsonParseException
JsonParser
JsonParser.nextToken()
, or
after encountering end-of-input), returns null.
Method can be called for any event.
getText
in class JsonParser
IOException
JsonParseException
protected final JsonToken parseNumberText(int ch) throws IOException, JsonParseException
Because much of input has to be processed in any case, no partial parsing is done: all input text will be stored for further processing. However, actual numeric value conversion will be deferred, since it is usually the most complicated and costliest part of processing.
IOException
JsonParseException
protected final void parseNumericValue() throws JsonParseException
JsonParseException
protected void convertNumberToInt() throws IOException, JsonParseException
IOException
JsonParseException
protected void convertNumberToLong() throws IOException, JsonParseException
IOException
JsonParseException
protected void convertNumberToDouble() throws IOException, JsonParseException
IOException
JsonParseException
protected void convertNumberToBigDecimal() throws IOException, JsonParseException
IOException
JsonParseException
protected void reportUnexpectedNumberChar(int ch, String comment) throws JsonParseException
JsonParseException
protected void reportInvalidNumber(String msg) throws JsonParseException
JsonParseException
protected void reportOverflowInt() throws IOException, JsonParseException
IOException
JsonParseException
protected void reportOverflowLong() throws IOException, JsonParseException
IOException
JsonParseException
|
JSON Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |