java.lang.Object
tools.jackson.core.JsonParser
tools.jackson.core.base.ParserMinimalBase
tools.jackson.databind.node.TreeTraversingParser
- All Implemented Interfaces:
Closeable,AutoCloseable,tools.jackson.core.Versioned
public class TreeTraversingParser
extends tools.jackson.core.base.ParserMinimalBase
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
tools.jackson.core.JsonParser.NumberType, tools.jackson.core.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
ConstructorsConstructorDescriptionTreeTraversingParser(JsonNode n, tools.jackson.core.ObjectReadContext readContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidvoidvoidclose()tools.jackson.core.TokenStreamLocationprotected JsonNodeprotected JsonNodecurrentNumericNode(int targetNumType) tools.jackson.core.TokenStreamLocationbyte[]getBinaryValue(tools.jackson.core.Base64Variant b64variant) doublefloatintlongtools.jackson.core.JsonParser.NumberTypetools.jackson.core.JsonParser.NumberTypeFPshortchar[]intintintintgetValueAsInt(int defaultValue) longlonggetValueAsLong(long defaultValue) booleanbooleanisClosed()booleanisNaN()tools.jackson.core.JsonTokenintreadBinaryValue(tools.jackson.core.Base64Variant b64variant, OutputStream out) tools.jackson.core.JsonParsertools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamReadCapability>tools.jackson.core.TokenStreamContexttools.jackson.core.Versionversion()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, _reportInvalidUTF8Surrogate, _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, readString, 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
public tools.jackson.core.Version version()- Specified by:
versionin interfacetools.jackson.core.Versioned- Specified by:
versionin classtools.jackson.core.JsonParser
-
streamReadCapabilities
public tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamReadCapability> streamReadCapabilities()- Overrides:
streamReadCapabilitiesin classtools.jackson.core.base.ParserMinimalBase
-
streamReadInputSource
- Specified by:
streamReadInputSourcein classtools.jackson.core.JsonParser
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classtools.jackson.core.base.ParserMinimalBase
-
_closeInput
- Specified by:
_closeInputin classtools.jackson.core.base.ParserMinimalBase- Throws:
IOException
-
_releaseBuffers
protected void _releaseBuffers()- Specified by:
_releaseBuffersin classtools.jackson.core.base.ParserMinimalBase
-
nextToken
public tools.jackson.core.JsonToken nextToken()- Specified by:
nextTokenin classtools.jackson.core.JsonParser
-
skipChildren
public tools.jackson.core.JsonParser skipChildren()- Overrides:
skipChildrenin classtools.jackson.core.base.ParserMinimalBase
-
isClosed
public boolean isClosed()- Overrides:
isClosedin classtools.jackson.core.base.ParserMinimalBase
-
currentName
- Specified by:
currentNamein classtools.jackson.core.JsonParser
-
streamReadContext
public tools.jackson.core.TokenStreamContext streamReadContext()- Specified by:
streamReadContextin classtools.jackson.core.JsonParser
-
assignCurrentValue
- Specified by:
assignCurrentValuein classtools.jackson.core.JsonParser
-
currentValue
- Specified by:
currentValuein classtools.jackson.core.JsonParser
-
currentTokenLocation
public tools.jackson.core.TokenStreamLocation currentTokenLocation()- Specified by:
currentTokenLocationin classtools.jackson.core.JsonParser
-
currentLocation
public tools.jackson.core.TokenStreamLocation currentLocation()- Specified by:
currentLocationin classtools.jackson.core.JsonParser
-
getString
- Specified by:
getStringin classtools.jackson.core.JsonParser
-
getStringCharacters
public char[] getStringCharacters()- Specified by:
getStringCharactersin classtools.jackson.core.JsonParser
-
getStringLength
public int getStringLength()- Specified by:
getStringLengthin classtools.jackson.core.JsonParser
-
getStringOffset
public int getStringOffset()- Specified by:
getStringOffsetin classtools.jackson.core.JsonParser
-
hasStringCharacters
public boolean hasStringCharacters()- Specified by:
hasStringCharactersin classtools.jackson.core.JsonParser
-
getNumberType
public tools.jackson.core.JsonParser.NumberType getNumberType()- Specified by:
getNumberTypein classtools.jackson.core.JsonParser
-
getNumberTypeFP
public tools.jackson.core.JsonParser.NumberTypeFP getNumberTypeFP()- Overrides:
getNumberTypeFPin classtools.jackson.core.base.ParserMinimalBase
-
getBigIntegerValue
- Specified by:
getBigIntegerValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.exc.InputCoercionException
-
getDecimalValue
- Specified by:
getDecimalValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.exc.InputCoercionException
-
getDoubleValue
public double getDoubleValue() throws tools.jackson.core.exc.InputCoercionException- Specified by:
getDoubleValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.exc.InputCoercionException
-
getFloatValue
public float getFloatValue() throws tools.jackson.core.exc.InputCoercionException- Specified by:
getFloatValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.exc.InputCoercionException
-
getShortValue
public short getShortValue() throws tools.jackson.core.exc.InputCoercionException- Overrides:
getShortValuein classtools.jackson.core.base.ParserMinimalBase- Throws:
tools.jackson.core.exc.InputCoercionException
-
getIntValue
public int getIntValue() throws tools.jackson.core.exc.InputCoercionException- Specified by:
getIntValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.exc.InputCoercionException
-
getValueAsInt
public int getValueAsInt()- Overrides:
getValueAsIntin classtools.jackson.core.base.ParserMinimalBase
-
getValueAsInt
public int getValueAsInt(int defaultValue) - Overrides:
getValueAsIntin classtools.jackson.core.base.ParserMinimalBase
-
getLongValue
public long getLongValue() throws tools.jackson.core.exc.InputCoercionException- Specified by:
getLongValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.exc.InputCoercionException
-
getValueAsLong
public long getValueAsLong()- Overrides:
getValueAsLongin classtools.jackson.core.base.ParserMinimalBase
-
getValueAsLong
public long getValueAsLong(long defaultValue) - Overrides:
getValueAsLongin classtools.jackson.core.base.ParserMinimalBase
-
getNumberValue
- Specified by:
getNumberValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.exc.InputCoercionException
-
getEmbeddedObject
- Overrides:
getEmbeddedObjectin classtools.jackson.core.base.ParserMinimalBase
-
isNaN
public boolean isNaN()- Specified by:
isNaNin classtools.jackson.core.JsonParser
-
getBinaryValue
public byte[] getBinaryValue(tools.jackson.core.Base64Variant b64variant) throws tools.jackson.core.JacksonException - Specified by:
getBinaryValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
readBinaryValue
public int readBinaryValue(tools.jackson.core.Base64Variant b64variant, OutputStream out) throws tools.jackson.core.JacksonException - Overrides:
readBinaryValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
currentNode
-
currentNumericNode
-
_handleEOF
protected void _handleEOF()- Specified by:
_handleEOFin classtools.jackson.core.base.ParserMinimalBase
-