Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.util

public Class TokenBufferReadContext

extends JsonStreamContext
Class Inheritance
Imports
com.fasterxml.jackson.core.*, com.fasterxml.jackson.core.io.ContentReference, com.fasterxml.jackson.core.json.JsonReadContext

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

Modifier and TypeField and Description
protected String
protected Object
protected final JsonStreamContext
protected final JsonLocation
Inherited from com.fasterxml.jackson.core.JsonStreamContext:
_index_nestingDepth_typeTYPE_ARRAYTYPE_OBJECTTYPE_ROOT

Constructor Summary

AccessConstructor and Description
protected
protected
protected
protected
TokenBufferReadContext()

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

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

Method Summary

Modifier and TypeMethod and Description
public TokenBufferReadContext
public TokenBufferReadContext
public static TokenBufferReadContext
public String
getCurrentName()

Implements abstract com.fasterxml.jackson.core.JsonStreamContext.getCurrentName.

Method for accessing name associated with the current location.

public Object
getCurrentValue()

Overrides com.fasterxml.jackson.core.JsonStreamContext.getCurrentValue.

Method for accessing currently active value being used by data-binding (as the source of streaming data to write, or destination of data being read), at this level in hierarchy.

public JsonStreamContext
getParent()

Implements abstract com.fasterxml.jackson.core.JsonStreamContext.getParent.

Accessor for finding parent context of this context; will return null for root context.

public boolean
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.

public void
public void
setCurrentValue(Object
Current value to assign to this context
v
)

Overrides com.fasterxml.jackson.core.JsonStreamContext.setCurrentValue.

Method to call to pass value to be returned via getCurrentValue; typically called indirectly through JsonParser#setCurrentValue or JsonGenerator#setCurrentValue).

public void
Inherited from com.fasterxml.jackson.core.JsonStreamContext:
getCurrentIndexgetEntryCountgetNestingDepthgetStartLocationgetTypeDeschasCurrentIndexhasPathSegmentinArrayinObjectinRootpathAsPointerpathAsPointerstartLocationtoStringtypeDesc

Field Detail

_currentNameback to summary
protected String _currentName
_currentValueback to summary
protected Object _currentValue
_parentback to summary
protected final JsonStreamContext _parent
_startLocationback to summary
protected final JsonLocation _startLocation

Constructor Detail

TokenBufferReadContextback to summary
protected TokenBufferReadContext(JsonStreamContext base, ContentReference srcRef)
Since
2.13
TokenBufferReadContextback to summary
protected TokenBufferReadContext(JsonStreamContext base, Object srcRef)

Deprecated

Annotations
@Deprecated
TokenBufferReadContextback to summary
protected TokenBufferReadContext(JsonStreamContext base, JsonLocation startLoc)
TokenBufferReadContextback to summary
protected TokenBufferReadContext()

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

TokenBufferReadContextback to summary
protected TokenBufferReadContext(TokenBufferReadContext parent, int type, int index)

Method Detail

createChildArrayContextback to summary
public TokenBufferReadContext createChildArrayContext()
createChildObjectContextback to summary
public TokenBufferReadContext createChildObjectContext()
createRootContextback to summary
public static TokenBufferReadContext createRootContext(JsonStreamContext origContext)
getCurrentNameback to summary
public String getCurrentName()

Implements abstract com.fasterxml.jackson.core.JsonStreamContext.getCurrentName.

Doc from com.fasterxml.jackson.core.JsonStreamContext.getCurrentName.

Method for accessing name associated with the current location. Non-null for FIELD_NAME and value events that directly follow field names; null for root level and array values.

Returns:String

Current field name within context, if any; null if none

Annotations
@Override
getCurrentValueback to summary
public Object getCurrentValue()

Overrides com.fasterxml.jackson.core.JsonStreamContext.getCurrentValue.

Doc from com.fasterxml.jackson.core.JsonStreamContext.getCurrentValue.

Method for accessing currently active value being used by data-binding (as the source of streaming data to write, or destination of data being read), at this level in hierarchy.

Note that "current value" is NOT populated (or used) by Streaming parser or generator; it is only used by higher-level data-binding functionality. The reason it is included here is that it can be stored and accessed hierarchically, and gets passed through data-binding.

Returns:Object

Currently active value, if one has been assigned.

Annotations
@Override
getParentback to summary
public JsonStreamContext getParent()

Implements abstract com.fasterxml.jackson.core.JsonStreamContext.getParent.

Doc from com.fasterxml.jackson.core.JsonStreamContext.getParent.

Accessor for finding parent context of this context; will return null for root context.

Returns:JsonStreamContext

Parent context of this context, if any; null for Root contexts

Annotations
@Override
hasCurrentNameback to summary
public boolean hasCurrentName()

Overrides com.fasterxml.jackson.core.JsonStreamContext.hasCurrentName.

Returns:boolean

Doc from com.fasterxml.jackson.core.JsonStreamContext.hasCurrentName.

True if a call to getCurrentName() would return non-null name; false otherwise

Annotations
@Override
parentOrCopyback to summary
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.

setCurrentNameback to summary
public void setCurrentName(String name) throws JsonProcessingException
setCurrentValueback to summary
public void setCurrentValue(Object v)

Overrides com.fasterxml.jackson.core.JsonStreamContext.setCurrentValue.

Doc from com.fasterxml.jackson.core.JsonStreamContext.setCurrentValue.

Method to call to pass value to be returned via getCurrentValue; typically called indirectly through JsonParser#setCurrentValue or JsonGenerator#setCurrentValue).

Parameters
v:Object

Current value to assign to this context

Annotations
@Override
updateForValueback to summary
public void updateForValue()
Since
2.10.1