Class TokenBufferReadContext
- java.lang.Object
-
- com.fasterxml.jackson.core.JsonStreamContext
-
- com.fasterxml.jackson.databind.util.TokenBufferReadContext
-
public class TokenBufferReadContext extends JsonStreamContext
Implementation ofJsonStreamContext
used byTokenBuffer
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenBufferReadContext
createChildArrayContext()
TokenBufferReadContext
createChildObjectContext()
static TokenBufferReadContext
createRootContext(JsonStreamContext origContext)
java.lang.String
getCurrentName()
Method for accessing name associated with the current location.java.lang.Object
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.JsonStreamContext
getParent()
Accessor for finding parent context of this context; will return null for root context.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(java.lang.String name)
void
setCurrentValue(java.lang.Object v)
Method to call to pass value to be returned viaJsonStreamContext.getCurrentValue()
; typically called indirectly throughJsonParser.setCurrentValue(java.lang.Object)
orJsonGenerator.setCurrentValue(java.lang.Object)
).void
updateForValue()
-
Methods inherited from class com.fasterxml.jackson.core.JsonStreamContext
getCurrentIndex, getEntryCount, getStartLocation, getTypeDesc, hasCurrentIndex, hasPathSegment, inArray, inObject, inRoot, pathAsPointer, pathAsPointer, startLocation, toString, typeDesc
-
-
-
-
Method Detail
-
getCurrentValue
public java.lang.Object getCurrentValue()
Description copied from class:JsonStreamContext
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.
- Overrides:
getCurrentValue
in classJsonStreamContext
- Returns:
- Currently active value, if one has been assigned.
-
setCurrentValue
public void setCurrentValue(java.lang.Object v)
Description copied from class:JsonStreamContext
Method to call to pass value to be returned viaJsonStreamContext.getCurrentValue()
; typically called indirectly throughJsonParser.setCurrentValue(java.lang.Object)
orJsonGenerator.setCurrentValue(java.lang.Object)
).- Overrides:
setCurrentValue
in classJsonStreamContext
- Parameters:
v
- Current value to assign to this context
-
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 java.lang.String getCurrentName()
Description copied from class:JsonStreamContext
Method for accessing name associated with the current location. Non-null forFIELD_NAME
and value events that directly follow field names; null for root level and array values.- Specified by:
getCurrentName
in classJsonStreamContext
- Returns:
- Current field name within context, if any;
null
if none
-
hasCurrentName
public boolean hasCurrentName()
- Overrides:
hasCurrentName
in classJsonStreamContext
- Returns:
True
if a call toJsonStreamContext.getCurrentName()
would return non-null
name;false
otherwise
-
getParent
public JsonStreamContext getParent()
Description copied from class:JsonStreamContext
Accessor for finding parent context of this context; will return null for root context.- Specified by:
getParent
in classJsonStreamContext
- Returns:
- Parent context of this context, if any;
null
for Root contexts
-
setCurrentName
public void setCurrentName(java.lang.String name) throws JsonProcessingException
- Throws:
JsonProcessingException
-
updateForValue
public void updateForValue()
- Since:
- 2.10.1
-
-