Class TokenBufferReadContext
java.lang.Object
com.fasterxml.jackson.core.JsonStreamContext
com.fasterxml.jackson.databind.util.TokenBufferReadContext
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 inherited from class com.fasterxml.jackson.core.JsonStreamContext
TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT -
Method Summary
Modifier and TypeMethodDescriptionstatic TokenBufferReadContextcreateRootContext(JsonStreamContext origContext) Method for accessing name associated with the current location.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.Accessor for finding parent context of this context; will return null for root context.booleanHelper method we need to handle discontinuity between "real" contexts buffer creates, and ones from parent: problem being they are of different types.voidsetCurrentName(String name) voidMethod to call to pass value to be returned viaJsonStreamContext.getCurrentValue(); typically called indirectly throughJsonParser.setCurrentValue(java.lang.Object)orJsonGenerator.setCurrentValue(java.lang.Object)).voidMethods inherited from class com.fasterxml.jackson.core.JsonStreamContext
getCurrentIndex, getEntryCount, getNestingDepth, getStartLocation, getTypeDesc, hasCurrentIndex, hasPathSegment, inArray, inObject, inRoot, pathAsPointer, pathAsPointer, startLocation, toString, typeDesc
-
Method Details
-
getCurrentValue
Description copied from class:JsonStreamContextMethod 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.
- Overrides:
getCurrentValuein classJsonStreamContext- Returns:
- Currently active value, if one has been assigned.
-
setCurrentValue
Description copied from class:JsonStreamContextMethod to call to pass value to be returned viaJsonStreamContext.getCurrentValue(); typically called indirectly throughJsonParser.setCurrentValue(java.lang.Object)orJsonGenerator.setCurrentValue(java.lang.Object)).- Overrides:
setCurrentValuein classJsonStreamContext- Parameters:
v- Current value to assign to this context
-
createRootContext
-
createChildArrayContext
-
createChildObjectContext
-
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
Description copied from class:JsonStreamContextMethod for accessing name associated with the current location. Non-null forFIELD_NAMEand value events that directly follow field names; null for root level and array values.- Specified by:
getCurrentNamein classJsonStreamContext- Returns:
- Current field name within context, if any;
nullif none
-
hasCurrentName
public boolean hasCurrentName()- Overrides:
hasCurrentNamein classJsonStreamContext- Returns:
Trueif a call toJsonStreamContext.getCurrentName()would return non-nullname;falseotherwise
-
getParent
Description copied from class:JsonStreamContextAccessor for finding parent context of this context; will return null for root context.- Specified by:
getParentin classJsonStreamContext- Returns:
- Parent context of this context, if any;
nullfor Root contexts
-
setCurrentName
- Throws:
JsonProcessingException
-
updateForValue
public void updateForValue()- Since:
- 2.10.1
-