| Modifier and Type | Field and Description |
|---|---|
| protected int | _index
Index of the currently processed entry. |
| protected int | _nestingDepth
The nesting depth is a count of objects and arrays that have not been closed, `{` and `[` respectively. |
| protected int | _type
Indicates logical type of context as one of |
| public static final int | TYPE_ARRAY
Indicator for "Array" context. |
| public static final int | TYPE_OBJECT
Indicator for "Object" context. |
| public static final int | TYPE_ROOT
Indicator for "Root Value" context (has not parent) |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | JsonStreamContext(JsonStreamContext
Context instance to copy type and index from base)Copy constructor used by sub-classes for creating copies for buffering. |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final int | |
| public abstract String | Returns: Current field name within context, if any;null if noneMethod for accessing name associated with the current location. |
| public Object | Returns: Currently active value, if one has been assigned.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. |
| public final int | |
| public final int | Returns: Nesting depthThe nesting depth is a count of objects and arrays that have not been closed, `{` and `[` respectively. |
| public abstract JsonStreamContext | Returns: Parent context of this context, if any;null for Root contextsAccessor for finding parent context of this context; will return null for root context. |
| public JsonLocation | Returns: Location pointing to the point where the context start marker was found (or written); nevernull.Source reference needed to construct location instance srcRef)
Deprecated
Since 2.13 use
startLocation instead
|
| public final String | |
| public boolean | Returns: True if this context has value index to access, false otherwiseMethod that may be called to verify whether this context has valid index: will return `false` before the first entry of Object context or before first element of Array context; otherwise returns `true`. |
| public boolean | |
| public boolean | Returns: True if this context has value path segment to access, false otherwiseMethod that may be called to check if this context is either:
|
| public final boolean | Returns: True if this context represents an Array; false otherwiseMethod that returns true if this context is an Array context; that is, content is being read from or written to a JSON Array. |
| public final boolean | Returns: True if this context represents an Object; false otherwiseMethod that returns true if this context is an Object context; that is, content is being read from or written to a JSON Object. |
| public final boolean | Returns: True if this context represents a sequence of Root values; false otherwiseMethod that returns true if this context is a Root context; that is, content is being read from or written to without enclosing array or object structure. |
| public JsonPointer | Returns: Pointer instance constructedFactory method for constructing a |
| public JsonPointer | Returns: Pointer instance constructedWhether root-value offset is included as the first segment or not; includeRoot)Factory method for constructing a |
| public void | setCurrentValue(Object
Current value to assign to this context v)Method to call to pass value to be returned via |
| public JsonLocation | Returns: Location pointing to the point where the context start marker was found (or written); nevernull.Source reference needed to construct location instance srcRef)Optional method that may be used to access starting location of this context: for example, in case of JSON `Object` context, offset at which `[` token was read or written. |
| public String | Returns: Simple developer-readable description this context layer (note: NOT constructed with parents, unlikepathAsPointer)Overrides java. Overridden to provide developer readable "JsonPath" representation of the context. |
| public String | Returns: Type description StringMethod for accessing simple type description of current context; either ROOT (for root-level values), OBJECT (for field names and values of JSON Objects) or ARRAY (for values of JSON Arrays) |
| _index | back to summary |
|---|---|
| protected int _index Index of the currently processed entry. Starts with -1 to signal that no entries have been started, and gets advanced each time a new entry is started, either by encountering an expected separator, or with new values if no separators are expected (the case for root context). | |
| _nestingDepth | back to summary |
|---|---|
| protected int _nestingDepth The nesting depth is a count of objects and arrays that have not been closed, `{` and `[` respectively.
| |
| _type | back to summary |
|---|---|
| protected int _type Indicates logical type of context as one of | |
| TYPE_ARRAY | back to summary |
|---|---|
| public static final int TYPE_ARRAY Indicator for "Array" context. | |
| TYPE_OBJECT | back to summary |
|---|---|
| public static final int TYPE_OBJECT Indicator for "Object" context. | |
| TYPE_ROOT | back to summary |
|---|---|
| public static final int TYPE_ROOT Indicator for "Root Value" context (has not parent) | |
| JsonStreamContext | back to summary |
|---|---|
| protected JsonStreamContext() | |
| JsonStreamContext | back to summary |
|---|---|
| protected JsonStreamContext(JsonStreamContext base) Copy constructor used by sub-classes for creating copies for buffering.
| |
| JsonStreamContext | back to summary |
|---|---|
| protected JsonStreamContext(int type, int index) | |
| getCurrentIndex | back to summary |
|---|---|
public final int getCurrentIndex()
| |
| getCurrentName | back to summary |
|---|---|
| public abstract String getCurrentName() Method for accessing name associated with the current location.
Non-null for
| |
| getCurrentValue | back to summary |
|---|---|
| public 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. 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.
| |
| getEntryCount | back to summary |
|---|---|
public final int getEntryCount()
| |
| getNestingDepth | back to summary |
|---|---|
| public final int getNestingDepth() The nesting depth is a count of objects and arrays that have not been closed, `{` and `[` respectively.
| |
| getParent | back to summary |
|---|---|
| public abstract JsonStreamContext getParent() Accessor for finding parent context of this context; will return null for root context.
| |
| getStartLocation | back to summary |
|---|---|
| public JsonLocation getStartLocation(Object srcRef)
Deprecated Since 2.13 use
| |
| getTypeDesc | back to summary |
|---|---|
| public final String getTypeDesc()
Deprecated Since 2.8 use
| |
| hasCurrentIndex | back to summary |
|---|---|
| public boolean hasCurrentIndex() Method that may be called to verify whether this context has valid index: will return `false` before the first entry of Object context or before first element of Array context; otherwise returns `true`.
| |
| hasCurrentName | back to summary |
|---|---|
public boolean hasCurrentName()
| |
| hasPathSegment | back to summary |
|---|---|
| public boolean hasPathSegment() Method that may be called to check if this context is either:
Method is mostly used to determine whether this context should be used for
constructing
| |
| inArray | back to summary |
|---|---|
| public final boolean inArray() Method that returns true if this context is an Array context; that is, content is being read from or written to a JSON Array.
| |
| inObject | back to summary |
|---|---|
| public final boolean inObject() Method that returns true if this context is an Object context; that is, content is being read from or written to a JSON Object.
| |
| inRoot | back to summary |
|---|---|
| public final boolean inRoot() Method that returns true if this context is a Root context; that is, content is being read from or written to without enclosing array or object structure.
| |
| pathAsPointer | back to summary |
|---|---|
| public JsonPointer pathAsPointer() Factory method for constructing a
| |
| pathAsPointer | back to summary |
|---|---|
| public JsonPointer pathAsPointer(boolean includeRoot) Factory method for constructing a
| |
| setCurrentValue | back to summary |
|---|---|
| public void setCurrentValue(Object v) Method to call to pass value to be returned via
| |
| startLocation | back to summary |
|---|---|
| public JsonLocation startLocation(ContentReference srcRef) Optional method that may be used to access starting location of this context:
for example, in case of JSON `Object` context, offset at which `[` token was
read or written. Often used for error reporting purposes.
Implementations that do not keep track of such location are expected to return
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Overridden to provide developer readable "JsonPath" representation of the context.
| |
| typeDesc | back to summary |
|---|---|
| public String typeDesc() Method for accessing simple type description of current context; either ROOT (for root-level values), OBJECT (for field names and values of JSON Objects) or ARRAY (for values of JSON Arrays)
| |