|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.fasterxml.jackson.core.JsonStreamContext
com.fasterxml.jackson.core.json.JsonReadContext
public final class JsonReadContext
Extension of JsonStreamContext, which implements
core methods needed, and also exposes
more complete API to parser implementation classes.
| Field Summary | |
|---|---|
protected JsonReadContext |
_child
|
protected int |
_columnNr
|
protected String |
_currentName
|
protected Object |
_currentValue
|
protected DupDetector |
_dups
|
protected int |
_lineNr
|
protected JsonReadContext |
_parent
Parent context for this context; null for root context. |
| Fields inherited from class com.fasterxml.jackson.core.JsonStreamContext |
|---|
_index, _type, TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT |
| Constructor Summary | |
|---|---|
JsonReadContext(JsonReadContext parent,
DupDetector dups,
int type,
int lineNr,
int colNr)
|
|
| Method Summary | |
|---|---|
JsonReadContext |
clearAndGetParent()
Method that can be used to both clear the accumulated references (specifically value set with setCurrentValue(Object))
that should not be retained, and returns parent (as would
getParent() do). |
JsonReadContext |
createChildArrayContext(int lineNr,
int colNr)
|
JsonReadContext |
createChildObjectContext(int lineNr,
int colNr)
|
static JsonReadContext |
createRootContext(DupDetector dups)
|
static JsonReadContext |
createRootContext(int lineNr,
int colNr,
DupDetector dups)
|
boolean |
expectComma()
|
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. |
DupDetector |
getDupDetector()
|
JsonReadContext |
getParent()
Accessor for finding parent context of this context; will return null for root context. |
JsonLocation |
getStartLocation(Object srcRef)
|
protected void |
reset(int type,
int lineNr,
int colNr)
|
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)). |
String |
toString()
Overridden to provide developer readable "JsonPath" representation of the context. |
JsonReadContext |
withDupDetector(DupDetector dups)
|
| Methods inherited from class com.fasterxml.jackson.core.JsonStreamContext |
|---|
getCurrentIndex, getEntryCount, getTypeDesc, inArray, inObject, inRoot |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final JsonReadContext _parent
protected DupDetector _dups
protected JsonReadContext _child
protected String _currentName
protected Object _currentValue
protected int _lineNr
protected int _columnNr
| Constructor Detail |
|---|
public JsonReadContext(JsonReadContext parent,
DupDetector dups,
int type,
int lineNr,
int colNr)
| Method Detail |
|---|
protected void reset(int type,
int lineNr,
int colNr)
public JsonReadContext withDupDetector(DupDetector dups)
public 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(Object v)
JsonStreamContextJsonStreamContext.getCurrentValue(); typically
called indirectly through JsonParser.setCurrentValue(java.lang.Object)
or JsonGenerator.setCurrentValue(java.lang.Object)).
setCurrentValue in class JsonStreamContext
public static JsonReadContext createRootContext(int lineNr,
int colNr,
DupDetector dups)
public static JsonReadContext createRootContext(DupDetector dups)
public JsonReadContext createChildArrayContext(int lineNr,
int colNr)
public JsonReadContext createChildObjectContext(int lineNr,
int colNr)
public String getCurrentName()
JsonStreamContextFIELD_NAME and value events that directly
follow field names; null for root level and array values.
getCurrentName in class JsonStreamContextpublic JsonReadContext getParent()
JsonStreamContext
getParent in class JsonStreamContextpublic JsonReadContext clearAndGetParent()
setCurrentValue(Object))
that should not be retained, and returns parent (as would
getParent() do). Typically called when closing the active
context when encountering JsonToken.END_ARRAY or
JsonToken.END_OBJECT.
public JsonLocation getStartLocation(Object srcRef)
public DupDetector getDupDetector()
public boolean expectComma()
public void setCurrentName(String name)
throws JsonProcessingException
JsonProcessingExceptionpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||