public class TokenBufferReadContext extends JsonStreamContext
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.TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT| Modifier and Type | Method and 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 via
JsonStreamContext.getCurrentValue(); typically
called indirectly through JsonParser.setCurrentValue(java.lang.Object)
or JsonGenerator.setCurrentValue(java.lang.Object)). |
void |
updateForValue() |
getCurrentIndex, getEntryCount, getStartLocation, getTypeDesc, hasCurrentIndex, hasPathSegment, inArray, inObject, inRoot, pathAsPointer, pathAsPointer, startLocation, toString, typeDescpublic java.lang.Object getCurrentValue()
JsonStreamContextNote 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.
getCurrentValue in class JsonStreamContextpublic void setCurrentValue(java.lang.Object v)
JsonStreamContextJsonStreamContext.getCurrentValue(); typically
called indirectly through JsonParser.setCurrentValue(java.lang.Object)
or JsonGenerator.setCurrentValue(java.lang.Object)).setCurrentValue in class JsonStreamContextv - Current value to assign to this contextpublic static TokenBufferReadContext createRootContext(JsonStreamContext origContext)
public TokenBufferReadContext createChildArrayContext()
public TokenBufferReadContext createChildObjectContext()
public TokenBufferReadContext parentOrCopy()
public java.lang.String getCurrentName()
JsonStreamContextFIELD_NAME and value events that directly
follow field names; null for root level and array values.getCurrentName in class JsonStreamContextnull if nonepublic boolean hasCurrentName()
hasCurrentName in class JsonStreamContextTrue if a call to JsonStreamContext.getCurrentName() would return non-null
name; false otherwisepublic JsonStreamContext getParent()
JsonStreamContextgetParent in class JsonStreamContextnull for Root contextspublic void setCurrentName(java.lang.String name)
throws JsonProcessingException
JsonProcessingExceptionpublic void updateForValue()
Copyright © 2010 - 2023 Adobe. All Rights Reserved