Top Description Fields Constructors Methods
tools.jackson.core.util

public Class SimpleStreamReadContext

extends TokenStreamContext
Class Inheritance
Imports
tools.jackson.core.*, tools.jackson.core.exc.StreamReadException, tools.jackson.core.io.ContentReference, tools.jackson.core.json.DupDetector

Basic implementation of TokenStreamContext useful for most format backend JsonParser implementations (with notable exception of JSON that needs bit more advanced state).
Since
3.0

Field Summary

Modifier and TypeField and Description
protected SimpleStreamReadContext
protected int
protected String
protected Object
protected DupDetector
protected int
protected final SimpleStreamReadContext
_parent

Parent context for this context; null for root context.

Inherited from tools.jackson.core.TokenStreamContext:
_index_nestingDepth_typeTYPE_ARRAYTYPE_OBJECTTYPE_ROOT

Constructor Summary

AccessConstructor and Description
public
SimpleStreamReadContext(int type, SimpleStreamReadContext parent, int nestingDepth, DupDetector dups, int lineNr, int colNr)

public
SimpleStreamReadContext(int type, SimpleStreamReadContext parent, DupDetector dups, int lineNr, int colNr)
Deprecated

Method Summary

Modifier and TypeMethod and Description
protected void
public void
assignCurrentValue(Object v)

Overrides tools.jackson.core.TokenStreamContext.assignCurrentValue.

Method to call to pass value to be returned via currentValue; typically called indirectly through JsonParser#assignCurrentValue or JsonGenerator#assignCurrentValue).

public SimpleStreamReadContext

Returns:

Parent context of this context node, if any; null for root context
clearAndGetParent
()

Method that can be used to both clear the accumulated references (specifically value set with assignCurrentValue(Object)) that should not be retained, and returns parent (as would getParent() do).

public SimpleStreamReadContext
createChildArrayContext(int lineNr, int colNr)

public SimpleStreamReadContext
createChildObjectContext(int lineNr, int colNr)

public static SimpleStreamReadContext
createRootContext(int lineNr, int colNr, DupDetector dups)

public static SimpleStreamReadContext
public String
currentName()

Implements abstract tools.jackson.core.TokenStreamContext.currentName.

Method for accessing name associated with the current location.

public Object
currentValue()

Overrides tools.jackson.core.TokenStreamContext.currentValue.

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 DupDetector
public SimpleStreamReadContext
getParent()

Implements abstract tools.jackson.core.TokenStreamContext.getParent.

Accessor for finding parent context of this context; will return null for root context.

public boolean
protected void
reset(int type, int lineNr, int colNr)

public void
setCurrentName(String
Name of Object property encountered
name
)

Method called to indicate what the "current" name (Object property name just decoded) is: may also trigger duplicate detection.

public TokenStreamLocation
startLocation(ContentReference srcRef)

Overrides tools.jackson.core.TokenStreamContext.startLocation.

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 int

Returns:

Index after increment
valueRead
()

Method to call to advance index within current context: to be called when a new token found within current context (property name for objects, value for root and array contexts)

Inherited from tools.jackson.core.TokenStreamContext:
getCurrentIndexgetEntryCountgetNestingDepthhasCurrentIndexhasPathSegmentinArrayinObjectinRootpathAsPointerpathAsPointertoStringtypeDesc

Field Detail

_childToRecycleback to summary
protected SimpleStreamReadContext _childToRecycle
_columnNrback to summary
protected int _columnNr
_currentNameback to summary
protected String _currentName
_currentValueback to summary
protected Object _currentValue
_dupsback to summary
protected DupDetector _dups
_lineNrback to summary
protected int _lineNr
_parentback to summary
protected final SimpleStreamReadContext _parent

Parent context for this context; null for root context.

Constructor Detail

SimpleStreamReadContextback to summary
public SimpleStreamReadContext(int type, SimpleStreamReadContext parent, int nestingDepth, DupDetector dups, int lineNr, int colNr)
SimpleStreamReadContextback to summary
public SimpleStreamReadContext(int type, SimpleStreamReadContext parent, DupDetector dups, int lineNr, int colNr)

Deprecated

Annotations
@Deprecated

Method Detail

_checkDupback to summary
protected void _checkDup(DupDetector dd, String name) throws StreamReadException
assignCurrentValueback to summary
public void assignCurrentValue(Object v)

Overrides tools.jackson.core.TokenStreamContext.assignCurrentValue.

Doc from tools.jackson.core.TokenStreamContext.assignCurrentValue.

Method to call to pass value to be returned via currentValue; typically called indirectly through JsonParser#assignCurrentValue or JsonGenerator#assignCurrentValue).

Annotations
@Override
clearAndGetParentback to summary
public SimpleStreamReadContext clearAndGetParent()

Method that can be used to both clear the accumulated references (specifically value set with assignCurrentValue(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.

Returns:SimpleStreamReadContext

Parent context of this context node, if any; null for root context

createChildArrayContextback to summary
public SimpleStreamReadContext createChildArrayContext(int lineNr, int colNr)
createChildObjectContextback to summary
public SimpleStreamReadContext createChildObjectContext(int lineNr, int colNr)
createRootContextback to summary
public static SimpleStreamReadContext createRootContext(int lineNr, int colNr, DupDetector dups)
createRootContextback to summary
public static SimpleStreamReadContext createRootContext(DupDetector dups)
currentNameback to summary
public String currentName()

Implements abstract tools.jackson.core.TokenStreamContext.currentName.

Doc from tools.jackson.core.TokenStreamContext.currentName.

Method for accessing name associated with the current location. Non-null for PROPERTY_NAME and value events that directly follow Property names; null for root level and array values.

Annotations
@Override
Since
3.0
currentValueback to summary
public Object currentValue()

Overrides tools.jackson.core.TokenStreamContext.currentValue.

Doc from tools.jackson.core.TokenStreamContext.currentValue.

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.

Annotations
@Override
getDupDetectorback to summary
public DupDetector getDupDetector()
getParentback to summary
public SimpleStreamReadContext getParent()

Implements abstract tools.jackson.core.TokenStreamContext.getParent.

Doc from tools.jackson.core.TokenStreamContext.getParent.

Accessor for finding parent context of this context; will return null for root context.

Annotations
@Override
hasCurrentNameback to summary
public boolean hasCurrentName()

Overrides tools.jackson.core.TokenStreamContext.hasCurrentName.

Annotations
@Override
resetback to summary
protected void reset(int type, int lineNr, int colNr)
setCurrentNameback to summary
public void setCurrentName(String name) throws StreamReadException

Method called to indicate what the "current" name (Object property name just decoded) is: may also trigger duplicate detection.

Parameters
name:String

Name of Object property encountered

Exceptions
StreamReadException:
If there is a duplicate name violation
startLocationback to summary
public TokenStreamLocation startLocation(ContentReference srcRef)

Overrides tools.jackson.core.TokenStreamContext.startLocation.

Doc from tools.jackson.core.TokenStreamContext.startLocation.

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 TokenStreamLocation#NA; this is what the default implementation does.

Annotations
@Override
valueReadback to summary
public int valueRead()

Method to call to advance index within current context: to be called when a new token found within current context (property name for objects, value for root and array contexts)

Returns:int

Index after increment