Package org.codehaus.jackson.impl
Class JsonReadContext
- java.lang.Object
-
- org.codehaus.jackson.JsonStreamContext
-
- org.codehaus.jackson.impl.JsonReadContext
-
public final class JsonReadContext extends JsonStreamContext
Extension ofJsonStreamContext, which implements core methods needed, and also exposes more complete API to parser implementation classes.
-
-
Field Summary
Fields Modifier and Type Field Description protected JsonReadContext_childprotected int_columnNrprotected java.lang.String_currentNameprotected int_lineNrprotected JsonReadContext_parent-
Fields inherited from class org.codehaus.jackson.JsonStreamContext
_index, _type, TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT
-
-
Constructor Summary
Constructors Constructor Description JsonReadContext(JsonReadContext parent, int type, int lineNr, int colNr)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonReadContextcreateChildArrayContext(int lineNr, int colNr)JsonReadContextcreateChildObjectContext(int lineNr, int colNr)static JsonReadContextcreateRootContext()static JsonReadContextcreateRootContext(int lineNr, int colNr)booleanexpectComma()java.lang.StringgetCurrentName()Method for accessing name associated with the current location.JsonReadContextgetParent()Accessor for finding parent context of this context; will return null for root context.JsonLocationgetStartLocation(java.lang.Object srcRef)protected voidreset(int type, int lineNr, int colNr)voidsetCurrentName(java.lang.String name)java.lang.StringtoString()Overridden to provide developer readable "JsonPath" representation of the context.-
Methods inherited from class org.codehaus.jackson.JsonStreamContext
getCurrentIndex, getEntryCount, getTypeDesc, inArray, inObject, inRoot
-
-
-
-
Field Detail
-
_parent
protected final JsonReadContext _parent
-
_lineNr
protected int _lineNr
-
_columnNr
protected int _columnNr
-
_currentName
protected java.lang.String _currentName
-
_child
protected JsonReadContext _child
-
-
Constructor Detail
-
JsonReadContext
public JsonReadContext(JsonReadContext parent, int type, int lineNr, int colNr)
-
-
Method Detail
-
reset
protected final void reset(int type, int lineNr, int colNr)
-
createRootContext
public static JsonReadContext createRootContext(int lineNr, int colNr)
-
createRootContext
public static JsonReadContext createRootContext()
- Since:
- 1.9
-
createChildArrayContext
public final JsonReadContext createChildArrayContext(int lineNr, int colNr)
-
createChildObjectContext
public final JsonReadContext createChildObjectContext(int lineNr, int colNr)
-
getCurrentName
public final java.lang.String 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
-
getParent
public final JsonReadContext getParent()
Description copied from class:JsonStreamContextAccessor for finding parent context of this context; will return null for root context.- Specified by:
getParentin classJsonStreamContext
-
getStartLocation
public final JsonLocation getStartLocation(java.lang.Object srcRef)
- Returns:
- Location pointing to the point where the context start marker was found
-
expectComma
public final boolean expectComma()
-
setCurrentName
public void setCurrentName(java.lang.String name)
-
toString
public final java.lang.String toString()
Overridden to provide developer readable "JsonPath" representation of the context.- Overrides:
toStringin classjava.lang.Object
-
-