com.fasterxml.jackson.databind.util

## Class TokenBufferReadContext

- java.lang.Object
- - com.fasterxml.jackson.core.JsonStreamContext
  - - com.fasterxml.jackson.databind.util.TokenBufferReadContext

    public class TokenBufferReadContext
    extends JsonStreamContext

Implementation of `JsonStreamContext` used by `TokenBuffer` to link back to the original context to try to keep location information consistent between source location and buffered content when it's re-read from the buffer.

Since:
  2.9

### Field Summary

Fields
`protected String` `_currentName`
`protected Object` `_currentValue`
`protected JsonStreamContext` `_parent`
`protected JsonLocation` `_startLocation`

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

`_index, _nestingDepth, _type, TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT`

### Constructor Summary

Constructors
`protected` `TokenBufferReadContext()` Constructor for case where there is no real surrounding context: just create virtual ROOT
`protected` `TokenBufferReadContext(JsonStreamContext base, ContentReference srcRef)`
`protected` `TokenBufferReadContext(JsonStreamContext base, JsonLocation startLoc)`
`protected` `TokenBufferReadContext(JsonStreamContext base, Object srcRef)` Deprecated.
`protected` `TokenBufferReadContext(TokenBufferReadContext parent, int type, int index)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`TokenBufferReadContext` `createChildArrayContext()`
`TokenBufferReadContext` `createChildObjectContext()`
`static TokenBufferReadContext` `createRootContext(JsonStreamContext origContext)`
`String` `getCurrentName()`
`Object` `getCurrentValue()`
`JsonStreamContext` `getParent()`
`boolean` `hasCurrentName()`
`TokenBufferReadContext` `parentOrCopy()` Helper method we need to handle discontinuity between "real" contexts buffer creates, and ones from parent: problem being they are of different types.
`void` `setCurrentName(String name)`
`void` `setCurrentValue(Object v)`
`void` `updateForValue()`

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

`getCurrentIndex, getEntryCount, getNestingDepth, getStartLocation, getTypeDesc, hasCurrentIndex, hasPathSegment, inArray, inObject, inRoot, pathAsPointer, pathAsPointer, startLocation, toString, typeDesc`

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

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

### Field Detail

#### _parent

    protected final JsonStreamContext _parent

#### _startLocation

    protected final JsonLocation _startLocation

#### _currentName

    protected String _currentName

#### _currentValue

    protected Object _currentValue

### Constructor Detail

#### TokenBufferReadContext

    protected TokenBufferReadContext(JsonStreamContext base,
                                     ContentReference srcRef)

Since:
  2.13

#### TokenBufferReadContext

    @Deprecated
    protected TokenBufferReadContext(JsonStreamContext base,
                                                 Object srcRef)

Deprecated.

#### TokenBufferReadContext

    protected TokenBufferReadContext(JsonStreamContext base,
                                     JsonLocation startLoc)

#### TokenBufferReadContext

    protected TokenBufferReadContext()

Constructor for case where there is no real surrounding context: just create virtual ROOT

#### TokenBufferReadContext

    protected TokenBufferReadContext(TokenBufferReadContext parent,
                                     int type,
                                     int index)

### Method Detail

#### getCurrentValue

    public Object getCurrentValue()

Overrides:
  `getCurrentValue` in class `JsonStreamContext`

#### setCurrentValue

    public void setCurrentValue(Object v)

Overrides:
  `setCurrentValue` in class `JsonStreamContext`

#### createRootContext

    public static TokenBufferReadContext createRootContext(JsonStreamContext origContext)

#### createChildArrayContext

    public TokenBufferReadContext createChildArrayContext()

#### createChildObjectContext

    public TokenBufferReadContext createChildObjectContext()

#### parentOrCopy

    public TokenBufferReadContext parentOrCopy()

Helper method we need to handle discontinuity between "real" contexts buffer creates, and ones from parent: problem being they are of different types.

#### getCurrentName

    public String getCurrentName()

Specified by:
  `getCurrentName` in class `JsonStreamContext`

#### hasCurrentName

    public boolean hasCurrentName()

Overrides:
  `hasCurrentName` in class `JsonStreamContext`

#### getParent

    public JsonStreamContext getParent()

Specified by:
  `getParent` in class `JsonStreamContext`

#### setCurrentName

    public void setCurrentName(String name)
                        throws JsonProcessingException

Throws:
  `JsonProcessingException`

#### updateForValue

    public void updateForValue()

Since:
  2.10.1