com.fasterxml.jackson.databind.node

## Class TreeTraversingParser

- java.lang.Object
- - com.fasterxml.jackson.core.JsonParser
  - - com.fasterxml.jackson.core.base.ParserMinimalBase
    - - com.fasterxml.jackson.databind.node.TreeTraversingParser

All Implemented Interfaces:
  Versioned, Closeable, AutoCloseable

    public class TreeTraversingParser
    extends 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 com.fasterxml.jackson.core.JsonParser

`JsonParser.Feature, JsonParser.NumberType, JsonParser.NumberTypeFP`

### Field Summary

Fields
`protected boolean` `_closed` Flag that indicates whether parser is closed or not.
`protected com.fasterxml.jackson.databind.node.NodeCursor` `_nodeCursor` Traversal context within tree
`protected ObjectCodec` `_objectCodec`

### Fields inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase

`_currToken, _lastClearedToken, _streamReadConstraints, _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_ERROR_TOKEN_LENGTH, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MIN_INT_D, MIN_INT_L, MIN_LONG_D, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN`

### Fields inherited from class com.fasterxml.jackson.core.JsonParser

`_features, _requestPayload, DEFAULT_READ_CAPABILITIES`

### Constructor Summary

Constructors
Constructor and Description
`TreeTraversingParser(JsonNode n)`
`TreeTraversingParser(JsonNode n, ObjectCodec codec)`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`protected void` `_handleEOF()`
`void` `close()`
`JsonLocation` `currentLocation()`
`String` `currentName()`
`protected JsonNode` `currentNode()`
`protected JsonNode` `currentNumericNode()`
`JsonLocation` `currentTokenLocation()`
`BigInteger` `getBigIntegerValue()`
`byte[]` `getBinaryValue(Base64Variant b64variant)`
`ObjectCodec` `getCodec()`
`JsonLocation` `getCurrentLocation()` Deprecated.
`String` `getCurrentName()` Deprecated.
`BigDecimal` `getDecimalValue()`
`double` `getDoubleValue()`
`Object` `getEmbeddedObject()`
`float` `getFloatValue()`
`int` `getIntValue()`
`long` `getLongValue()`
`JsonParser.NumberType` `getNumberType()`
`JsonParser.NumberTypeFP` `getNumberTypeFP()`
`Number` `getNumberValue()`
`JsonStreamContext` `getParsingContext()`
`JacksonFeatureSet<StreamReadCapability>` `getReadCapabilities()`
`String` `getText()`
`char[]` `getTextCharacters()`
`int` `getTextLength()`
`int` `getTextOffset()`
`JsonLocation` `getTokenLocation()` Deprecated.
`boolean` `hasTextCharacters()`
`boolean` `isClosed()`
`boolean` `isNaN()`
`JsonToken` `nextToken()`
`void` `overrideCurrentName(String name)`
`int` `readBinaryValue(Base64Variant b64variant, OutputStream out)`
`void` `setCodec(ObjectCodec c)`
`JsonParser` `skipChildren()`
`Version` `version()`

### Methods inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase

`_ascii, _asciiBytes, _constructError, _currentLocationMinusOne, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _nullSafeUpdateToken, _reportError, _reportError, _reportError, _reportInputCoercion, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidUTF8Surrogate, _reportMissingRootWS, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _throwInternalReturnAny, _throwInvalidSpace, _updateToken, _updateTokenToNA, _updateTokenToNull, _wrapError, clearCurrentToken, currentToken, currentTokenCount, currentTokenId, getCurrentToken, getCurrentTokenId, getLastClearedToken, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextValue, reportInvalidNumber, reportOverflowInt, reportOverflowInt, reportOverflowInt, reportOverflowLong, reportOverflowLong, reportOverflowLong, reportUnexpectedNumberChar, streamReadConstraints`

### Methods inherited from class com.fasterxml.jackson.core.JsonParser

`_codec, _constructError, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, assignCurrentValue, canParseAsync, canReadObjectId, canReadTypeId, canUseSchema, configure, currentValue, disable, enable, finishToken, getBinaryValue, getBooleanValue, getByteValue, getCurrentValue, getFeatureMask, getFormatFeatures, getInputSource, getNonBlockingInputFeeder, getNumberValueDeferred, getNumberValueExact, getObjectId, getSchema, getShortValue, getText, getTypeId, getValueAsBoolean, getValueAsDouble, isEnabled, isEnabled, nextBooleanValue, nextFieldName, nextFieldName, nextIntValue, nextLongValue, nextTextValue, overrideFormatFeatures, overrideStdFeatures, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, releaseBuffered, requiresCustomCodec, setCurrentValue, setFeatureMask, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnError, setSchema`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### _objectCodec

    protected ObjectCodec _objectCodec

#### _nodeCursor

    protected com.fasterxml.jackson.databind.node.NodeCursor _nodeCursor

Traversal context within tree

#### _closed

    protected boolean _closed

Flag 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 Detail

#### TreeTraversingParser

    public TreeTraversingParser(JsonNode n)

#### TreeTraversingParser

    public TreeTraversingParser(JsonNode n,
                                ObjectCodec codec)

### Method Detail

#### setCodec

    public void setCodec(ObjectCodec c)

Specified by:
  `setCodec` in class `JsonParser`

#### getCodec

    public ObjectCodec getCodec()

Specified by:
  `getCodec` in class `JsonParser`

#### version

    public Version version()

Specified by:
  `version` in interface `Versioned`
Specified by:
  `version` in class `JsonParser`

#### getReadCapabilities

    public JacksonFeatureSet<StreamReadCapability> getReadCapabilities()

Overrides:
  `getReadCapabilities` in class `JsonParser`

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in class `ParserMinimalBase`
Throws:
  `IOException`

#### nextToken

    public JsonToken nextToken()
                        throws IOException

Specified by:
  `nextToken` in class `ParserMinimalBase`
Throws:
  `IOException`

#### skipChildren

    public JsonParser skipChildren()
                            throws IOException

Overrides:
  `skipChildren` in class `ParserMinimalBase`
Throws:
  `IOException`

#### isClosed

    public boolean isClosed()

Specified by:
  `isClosed` in class `ParserMinimalBase`

#### currentName

    public String currentName()

Overrides:
  `currentName` in class `JsonParser`

#### getCurrentName

    @Deprecated
    public String getCurrentName()

Deprecated.

Specified by:
  `getCurrentName` in class `ParserMinimalBase`

#### overrideCurrentName

    public void overrideCurrentName(String name)

Specified by:
  `overrideCurrentName` in class `ParserMinimalBase`

#### getParsingContext

    public JsonStreamContext getParsingContext()

Specified by:
  `getParsingContext` in class `ParserMinimalBase`

#### currentLocation

    public JsonLocation currentLocation()

Overrides:
  `currentLocation` in class `JsonParser`

#### currentTokenLocation

    public JsonLocation currentTokenLocation()

Overrides:
  `currentTokenLocation` in class `JsonParser`

#### getTokenLocation

    @Deprecated
    public JsonLocation getTokenLocation()

Deprecated.

Specified by:
  `getTokenLocation` in class `JsonParser`

#### getCurrentLocation

    @Deprecated
    public JsonLocation getCurrentLocation()

Deprecated.

Specified by:
  `getCurrentLocation` in class `JsonParser`

#### getText

    public String getText()

Specified by:
  `getText` in class `ParserMinimalBase`

#### getTextCharacters

    public char[] getTextCharacters()
                             throws IOException

Specified by:
  `getTextCharacters` in class `ParserMinimalBase`
Throws:
  `IOException`

#### getTextLength

    public int getTextLength()
                      throws IOException

Specified by:
  `getTextLength` in class `ParserMinimalBase`
Throws:
  `IOException`

#### getTextOffset

    public int getTextOffset()
                      throws IOException

Specified by:
  `getTextOffset` in class `ParserMinimalBase`
Throws:
  `IOException`

#### hasTextCharacters

    public boolean hasTextCharacters()

Specified by:
  `hasTextCharacters` in class `ParserMinimalBase`

#### getNumberType

    public JsonParser.NumberType getNumberType()
                                        throws IOException

Specified by:
  `getNumberType` in class `JsonParser`
Throws:
  `IOException`

#### getNumberTypeFP

    public JsonParser.NumberTypeFP getNumberTypeFP()
                                            throws IOException

Overrides:
  `getNumberTypeFP` in class `JsonParser`
Throws:
  `IOException`

#### getBigIntegerValue

    public BigInteger getBigIntegerValue()
                                  throws IOException

Specified by:
  `getBigIntegerValue` in class `JsonParser`
Throws:
  `IOException`

#### getDecimalValue

    public BigDecimal getDecimalValue()
                               throws IOException

Specified by:
  `getDecimalValue` in class `JsonParser`
Throws:
  `IOException`

#### getDoubleValue

    public double getDoubleValue()
                          throws IOException

Specified by:
  `getDoubleValue` in class `JsonParser`
Throws:
  `IOException`

#### getFloatValue

    public float getFloatValue()
                        throws IOException

Specified by:
  `getFloatValue` in class `JsonParser`
Throws:
  `IOException`

#### getIntValue

    public int getIntValue()
                    throws IOException

Specified by:
  `getIntValue` in class `JsonParser`
Throws:
  `IOException`

#### getLongValue

    public long getLongValue()
                      throws IOException

Specified by:
  `getLongValue` in class `JsonParser`
Throws:
  `IOException`

#### getNumberValue

    public Number getNumberValue()
                          throws IOException

Specified by:
  `getNumberValue` in class `JsonParser`
Throws:
  `IOException`

#### getEmbeddedObject

    public Object getEmbeddedObject()

Overrides:
  `getEmbeddedObject` in class `JsonParser`

#### isNaN

    public boolean isNaN()

Overrides:
  `isNaN` in class `JsonParser`

#### getBinaryValue

    public byte[] getBinaryValue(Base64Variant b64variant)
                          throws IOException

Specified by:
  `getBinaryValue` in class `ParserMinimalBase`
Throws:
  `IOException`

#### readBinaryValue

    public int readBinaryValue(Base64Variant b64variant,
                               OutputStream out)
                        throws IOException

Overrides:
  `readBinaryValue` in class `JsonParser`
Throws:
  `IOException`

#### currentNode

    protected JsonNode currentNode()

#### currentNumericNode

    protected JsonNode currentNumericNode()
                                   throws JacksonException

Throws:
  `JacksonException`

#### _handleEOF

    protected void _handleEOF()

Specified by:
  `_handleEOF` in class `ParserMinimalBase`