org.codehaus.jackson.impl
Class ReaderBasedNumericParser
java.lang.Object
org.codehaus.jackson.JsonParser
org.codehaus.jackson.impl.JsonParserMinimalBase
org.codehaus.jackson.impl.JsonParserBase
org.codehaus.jackson.impl.JsonNumericParserBase
org.codehaus.jackson.impl.ReaderBasedParserBase
org.codehaus.jackson.impl.ReaderBasedNumericParser
- All Implemented Interfaces:
- Closeable, Versioned
- Direct Known Subclasses:
- ReaderBasedParser
public abstract class ReaderBasedNumericParser
- extends ReaderBasedParserBase
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.
Fields inherited from class org.codehaus.jackson.impl.JsonNumericParserBase |
_expLength, _fractLength, _intLength, _numberBigDecimal, _numberBigInt, _numberDouble, _numberInt, _numberLong, _numberNegative, _numTypesValid, CHAR_NULL, INT_0, INT_1, INT_2, INT_3, INT_4, INT_5, INT_6, INT_7, INT_8, INT_9, INT_DECIMAL_POINT, INT_e, INT_E, INT_MINUS, INT_PLUS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_INT, NR_LONG, NR_UNKNOWN |
Fields inherited from class org.codehaus.jackson.impl.JsonParserBase |
_binaryValue, _byteArrayBuilder, _closed, _currInputProcessed, _currInputRow, _currInputRowStart, _inputEnd, _inputPtr, _ioContext, _nameCopied, _nameCopyBuffer, _nextToken, _parsingContext, _textBuffer, _tokenInputCol, _tokenInputRow, _tokenInputTotal |
Fields inherited from class org.codehaus.jackson.impl.JsonParserMinimalBase |
INT_APOSTROPHE, INT_ASTERISK, INT_b, INT_BACKSLASH, INT_COLON, INT_COMMA, INT_CR, INT_f, INT_LBRACKET, INT_LCURLY, INT_LF, INT_n, INT_QUOTE, INT_r, INT_RBRACKET, INT_RCURLY, INT_SLASH, INT_SPACE, INT_t, INT_TAB, INT_u |
Methods inherited from class org.codehaus.jackson.impl.JsonNumericParserBase |
_parseNumericValue, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToInt, convertNumberToLong, getBigIntegerValue, getDecimalValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getNumberType, getNumberValue, reportInvalidNumber, reportOverflowInt, reportOverflowLong, reportUnexpectedNumberChar, reset, resetAsNaN, resetFloat, resetInt |
Methods inherited from class org.codehaus.jackson.impl.JsonParserBase |
_decodeBase64, _finishString, _getByteArrayBuilder, _handleEOF, _reportMismatchedEndMarker, close, getCurrentLocation, getCurrentName, getParsingContext, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, getTokenLocation, hasTextCharacters, isClosed, loadMoreGuaranteed, version |
Methods inherited from class org.codehaus.jackson.impl.JsonParserMinimalBase |
_constructError, _getCharDesc, _handleUnrecognizedCharacterEscape, _reportError, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportUnexpectedChar, _throwInternal, _throwInvalidSpace, _throwUnquotedSpace, _wrapError, getBinaryValue, getText, getTextCharacters, getTextLength, getTextOffset, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsLong, nextToken, skipChildren |
Methods inherited from class org.codehaus.jackson.JsonParser |
_constructError, canUseSchema, clearCurrentToken, configure, disable, disableFeature, enable, enableFeature, getBinaryValue, getBooleanValue, getByteValue, getCodec, getCurrentToken, getEmbeddedObject, getLastClearedToken, getShortValue, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsLong, hasCurrentToken, isEnabled, isExpectedStartArrayToken, isFeatureEnabled, nextValue, readValueAs, readValueAs, readValueAsTree, releaseBuffered, setCodec, setFeature, setSchema |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReaderBasedNumericParser
public ReaderBasedNumericParser(IOContext pc,
int features,
Reader r)
parseNumberText
protected final JsonToken parseNumberText(int ch)
throws IOException,
JsonParseException
- Initial parsing method for number values. It needs to be able
to parse enough input to be able to determine whether the
value is to be considered a simple integer value, or a more
generic decimal value: latter of which needs to be expressed
as a floating point number. The basic rule is that if the number
has no fractional or exponential part, it is an integer; otherwise
a floating point number.
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.
- Throws:
IOException
JsonParseException
_handleInvalidNumberStart
protected JsonToken _handleInvalidNumberStart(int ch,
boolean negative)
throws IOException,
JsonParseException
- Method called if expected numeric value (due to leading sign) does not
look like a number
- Throws:
IOException
JsonParseException