Top Description Fields Constructors Methods
tools.jackson.dataformat.cbor

public final Class CBORReadContext

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

Extension of tools.jackson.core.TokenStreamContext to support features needed by CBOR format (mainly limits of expected entries to output).

Field Summary

Modifier and TypeField and Description
protected CBORReadContext
protected String
protected Object
protected final DupDetector
protected int
_expEntryCount

For fixed-size Arrays, Objects, this indicates expected number of entries.

protected final CBORReadContext
_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
CBORReadContext(CBORReadContext parent, DupDetector dups, int type, int expEntryCount)

Method Summary

Modifier and TypeMethod and Description
private void
public boolean
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 CBORReadContext
createChildArrayContext(int expEntryCount)

public CBORReadContext
createChildObjectContext(int expEntryCount)

public static CBORReadContext
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 boolean
expectMoreValues()

Method called to increment the current entry count (Object property, Array element or Root value) for this context level and then see if more entries are accepted.

public int
public CBORReadContext
getParent()

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

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

public int
public boolean
protected void
reset(int type, int expEntryCount)

public void
public TokenStreamLocation

Returns:

Location pointing to the point where the context start marker was found
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 String
toString()

Overrides tools.jackson.core.TokenStreamContext.toString.

Overridden to provide developer readable "JsonPath" representation of the context.

Inherited from tools.jackson.core.TokenStreamContext:
getCurrentIndexgetEntryCountgetNestingDepthhasCurrentIndexhasCurrentNamehasPathSegmentinArrayinObjectinRootpathAsPointerpathAsPointertypeDesc

Field Detail

_childback to summary
protected CBORReadContext _child
_currentNameback to summary
protected String _currentName
_currentValueback to summary
protected Object _currentValue
_dupsback to summary
protected final DupDetector _dups
_expEntryCountback to summary
protected int _expEntryCount

For fixed-size Arrays, Objects, this indicates expected number of entries.

_parentback to summary
protected final CBORReadContext _parent

Parent context for this context; null for root context.

Constructor Detail

CBORReadContextback to summary
public CBORReadContext(CBORReadContext parent, DupDetector dups, int type, int expEntryCount)

Method Detail

_checkDupback to summary
private void _checkDup(DupDetector dd, String name) throws StreamReadException
acceptsBreakMarkerback to summary
public boolean acceptsBreakMarker()
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
createChildArrayContextback to summary
public CBORReadContext createChildArrayContext(int expEntryCount)
createChildObjectContextback to summary
public CBORReadContext createChildObjectContext(int expEntryCount)
createRootContextback to summary
public static CBORReadContext 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
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
expectMoreValuesback to summary
public boolean expectMoreValues()

Method called to increment the current entry count (Object property, Array element or Root value) for this context level and then see if more entries are accepted. The only case where more entries are NOT expected is for fixed-count Objects and Arrays that just reached the entry count.

Note that since the entry count is updated this is a state-changing method.

getExpectedLengthback to summary
public int getExpectedLength()
getParentback to summary
public CBORReadContext 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
getRemainingExpectedLengthback to summary
public int getRemainingExpectedLength()
hasExpectedLengthback to summary
public boolean hasExpectedLength()
resetback to summary
protected void reset(int type, int expEntryCount)
setCurrentNameback to summary
public void setCurrentName(String name) throws StreamReadException
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.

Returns:TokenStreamLocation

Location pointing to the point where the context start marker was found

Annotations
@Override
toStringback to summary
public String toString()

Overrides tools.jackson.core.TokenStreamContext.toString.

Overridden to provide developer readable "JsonPath" representation of the context.

Annotations
@Override