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.Modifier and Type | Field and Description |
---|---|
protected String |
_currentName |
protected Object |
_currentValue |
protected JsonStreamContext |
_parent |
protected JsonLocation |
_startLocation |
_index, _type, TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT
Modifier | Constructor and Description |
---|---|
protected |
TokenBufferReadContext()
Constructor for case where there is no real surrounding context: just create
virtual ROOT
|
protected |
TokenBufferReadContext(JsonStreamContext base,
JsonLocation startLoc) |
protected |
TokenBufferReadContext(JsonStreamContext base,
Object srcRef) |
protected |
TokenBufferReadContext(TokenBufferReadContext parent,
int type,
int index) |
Modifier and Type | Method and Description |
---|---|
TokenBufferReadContext |
createChildArrayContext() |
TokenBufferReadContext |
createChildObjectContext() |
static TokenBufferReadContext |
createRootContext(JsonStreamContext origContext) |
String |
getCurrentName()
Method for accessing name associated with the current location.
|
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(String name) |
void |
setCurrentValue(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) ). |
getCurrentIndex, getEntryCount, getStartLocation, getTypeDesc, hasCurrentIndex, hasPathSegment, inArray, inObject, inRoot, pathAsPointer, pathAsPointer, toString, typeDesc
protected final JsonStreamContext _parent
protected final JsonLocation _startLocation
protected String _currentName
protected Object _currentValue
protected TokenBufferReadContext(JsonStreamContext base, Object srcRef)
protected TokenBufferReadContext(JsonStreamContext base, JsonLocation startLoc)
protected TokenBufferReadContext()
protected TokenBufferReadContext(TokenBufferReadContext parent, int type, int index)
public Object getCurrentValue()
JsonStreamContext
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.
getCurrentValue
in class JsonStreamContext
public void setCurrentValue(Object v)
JsonStreamContext
JsonStreamContext.getCurrentValue()
; typically
called indirectly through JsonParser.setCurrentValue(java.lang.Object)
or JsonGenerator.setCurrentValue(java.lang.Object)
).setCurrentValue
in class JsonStreamContext
public static TokenBufferReadContext createRootContext(JsonStreamContext origContext)
public TokenBufferReadContext createChildArrayContext()
public TokenBufferReadContext createChildObjectContext()
public TokenBufferReadContext parentOrCopy()
public String getCurrentName()
JsonStreamContext
FIELD_NAME
and value events that directly
follow field names; null for root level and array values.getCurrentName
in class JsonStreamContext
public boolean hasCurrentName()
hasCurrentName
in class JsonStreamContext
public JsonStreamContext getParent()
JsonStreamContext
getParent
in class JsonStreamContext
public void setCurrentName(String name) throws JsonProcessingException
JsonProcessingException
Copyright © 2019 JBoss by Red Hat. All rights reserved.