java.lang.Object
tools.jackson.core.JsonParser
tools.jackson.core.base.ParserMinimalBase
tools.jackson.databind.node.TreeTraversingParser
- All Implemented Interfaces:
Closeable,AutoCloseable,Versioned
Facade over
JsonNode that implements JsonParser to allow
accessing contents of JSON tree in alternate form (stream of tokens).
Useful when a streaming source is expected by code, such as data binding
functionality.-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.core.JsonParser
JsonParser.NumberType, JsonParser.NumberTypeFP -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanFlag that indicates whether parser is closed or not.protected tools.jackson.databind.node.NodeCursorTraversal context within treeprotected final JsonNodeFields inherited from class tools.jackson.core.base.ParserMinimalBase
_currToken, _ioContext, _lastClearedToken, _objectReadContext, _streamReadConstraints, _streamReadFeatures, _tokenCount, _trackMaxTokenCount, BD_MAX_INT, BD_MAX_LONG, BD_MIN_INT, BD_MIN_LONG, BI_MAX_INT, BI_MAX_LONG, BI_MIN_INT, BI_MIN_LONG, CHAR_NULL, INT_0, INT_9, INT_APOS, INT_ASTERISK, INT_BACKSLASH, INT_COLON, INT_COMMA, INT_CR, INT_e, INT_E, INT_HASH, INT_LBRACKET, INT_LCURLY, INT_LF, INT_MINUS, INT_PERIOD, INT_PLUS, INT_QUOTE, INT_RBRACKET, INT_RCURLY, INT_RS, INT_SLASH, INT_SPACE, INT_TAB, MAX_BYTE_I, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MAX_SHORT_I, MIN_BYTE_I, MIN_INT_D, MIN_INT_L, MIN_LONG_D, MIN_SHORT_I, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN, STREAM_READ_FEATURE_DEFAULTSFields inherited from class tools.jackson.core.JsonParser
DEFAULT_READ_CAPABILITIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidvoidvoidclose()protected JsonNodeprotected JsonNodecurrentNumericNode(int targetNumType) byte[]getBinaryValue(Base64Variant b64variant) doublefloatintlongshortchar[]intintintintgetValueAsInt(int defaultValue) longlonggetValueAsLong(long defaultValue) booleanbooleanisClosed()booleanisNaN()intreadBinaryValue(Base64Variant b64variant, OutputStream out) version()Methods inherited from class tools.jackson.core.base.ParserMinimalBase
_constructInputCoercion, _constructNotNumericType, _currentLocationMinusOne, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _nullSafeUpdateToken, _reportBadInputStream, _reportBadReader, _reportError, _reportError, _reportError, _reportError, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidNumber, _reportInvalidSpace, _reportMissingRootWS, _reportOverflowByte, _reportOverflowInt, _reportOverflowInt, _reportOverflowInt, _reportOverflowLong, _reportOverflowLong, _reportOverflowLong, _reportOverflowShort, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _updateToken, _updateTokenToNA, _updateTokenToNull, _wrapIOFailure, clearCurrentToken, currentNameMatch, currentToken, currentTokenCount, currentTokenId, finishToken, getBooleanValue, getByteValue, getLastClearedToken, getNumberValueDeferred, getNumberValueExact, getString, getValueAsBoolean, getValueAsDouble, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isEnabled, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextName, nextName, nextNameMatch, nextValue, objectReadContext, readValueAs, readValueAs, readValueAs, readValueAsTree, streamReadConstraints, streamReadFeaturesMethods inherited from class tools.jackson.core.JsonParser
_constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, canParseAsync, canReadObjectId, canReadTypeId, getBinaryValue, getObjectId, getSchema, getText, getTextCharacters, getTextLength, getTextOffset, getTypeId, getValueAsBoolean, getValueAsDouble, nextBooleanValue, nextIntValue, nextLongValue, nextStringValue, nonBlockingInputFeeder, readBinaryValue, releaseBuffered, releaseBuffered
-
Field Details
-
_source
- Since:
- 3.0
-
_nodeCursor
protected tools.jackson.databind.node.NodeCursor _nodeCursorTraversal context within tree -
_closed
protected boolean _closedFlag that indicates whether parser is closed or not. Gets set when parser is either closed by explicit call (close()) or when end-of-input is reached.
-
-
Constructor Details
-
TreeTraversingParser
-
TreeTraversingParser
-
-
Method Details
-
version
- Specified by:
versionin interfaceVersioned- Specified by:
versionin classJsonParser
-
streamReadCapabilities
- Overrides:
streamReadCapabilitiesin classParserMinimalBase
-
streamReadInputSource
- Specified by:
streamReadInputSourcein classJsonParser
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classParserMinimalBase
-
_closeInput
- Specified by:
_closeInputin classParserMinimalBase- Throws:
IOException
-
_releaseBuffers
protected void _releaseBuffers()- Specified by:
_releaseBuffersin classParserMinimalBase
-
nextToken
- Specified by:
nextTokenin classJsonParser
-
skipChildren
- Overrides:
skipChildrenin classParserMinimalBase
-
isClosed
public boolean isClosed()- Overrides:
isClosedin classParserMinimalBase
-
currentName
- Specified by:
currentNamein classJsonParser
-
streamReadContext
- Specified by:
streamReadContextin classJsonParser
-
assignCurrentValue
- Specified by:
assignCurrentValuein classJsonParser
-
currentValue
- Specified by:
currentValuein classJsonParser
-
currentTokenLocation
- Specified by:
currentTokenLocationin classJsonParser
-
currentLocation
- Specified by:
currentLocationin classJsonParser
-
getString
- Specified by:
getStringin classJsonParser
-
getStringCharacters
public char[] getStringCharacters()- Specified by:
getStringCharactersin classJsonParser
-
getStringLength
public int getStringLength()- Specified by:
getStringLengthin classJsonParser
-
getStringOffset
public int getStringOffset()- Specified by:
getStringOffsetin classJsonParser
-
hasStringCharacters
public boolean hasStringCharacters()- Specified by:
hasStringCharactersin classJsonParser
-
getNumberType
- Specified by:
getNumberTypein classJsonParser
-
getNumberTypeFP
- Overrides:
getNumberTypeFPin classParserMinimalBase
-
getBigIntegerValue
- Specified by:
getBigIntegerValuein classJsonParser- Throws:
InputCoercionException
-
getDecimalValue
- Specified by:
getDecimalValuein classJsonParser- Throws:
InputCoercionException
-
getDoubleValue
- Specified by:
getDoubleValuein classJsonParser- Throws:
InputCoercionException
-
getFloatValue
- Specified by:
getFloatValuein classJsonParser- Throws:
InputCoercionException
-
getShortValue
- Overrides:
getShortValuein classParserMinimalBase- Throws:
InputCoercionException
-
getIntValue
- Specified by:
getIntValuein classJsonParser- Throws:
InputCoercionException
-
getValueAsInt
public int getValueAsInt()- Overrides:
getValueAsIntin classParserMinimalBase
-
getValueAsInt
public int getValueAsInt(int defaultValue) - Overrides:
getValueAsIntin classParserMinimalBase
-
getLongValue
- Specified by:
getLongValuein classJsonParser- Throws:
InputCoercionException
-
getValueAsLong
public long getValueAsLong()- Overrides:
getValueAsLongin classParserMinimalBase
-
getValueAsLong
public long getValueAsLong(long defaultValue) - Overrides:
getValueAsLongin classParserMinimalBase
-
getNumberValue
- Specified by:
getNumberValuein classJsonParser- Throws:
InputCoercionException
-
getEmbeddedObject
- Overrides:
getEmbeddedObjectin classParserMinimalBase
-
isNaN
public boolean isNaN()- Specified by:
isNaNin classJsonParser
-
getBinaryValue
- Specified by:
getBinaryValuein classJsonParser- Throws:
JacksonException
-
readBinaryValue
- Overrides:
readBinaryValuein classJsonParser- Throws:
JacksonException
-
currentNode
-
currentNumericNode
-
_handleEOF
protected void _handleEOF()- Specified by:
_handleEOFin classParserMinimalBase
-