Top Description Fields Constructors Methods
com.fasterxml.jackson.dataformat.cbor

public final Class CBORReadContext

extends JsonStreamContext
Class Inheritance
Imports
com.fasterxml.jackson.core.*, com.fasterxml.jackson.core.io.CharTypes, .ContentReference, com.fasterxml.jackson.core.json.DupDetector

Replacement of com.fasterxml.jackson.core.json.JsonReadContext to support features needed by CBOR format.

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 com.fasterxml.jackson.core.JsonStreamContext:
_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 CBORReadContext
createChildArrayContext(int expEntryCount)

public CBORReadContext
createChildObjectContext(int expEntryCount)

public static CBORReadContext
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 String
getCurrentName()

Implements abstract com.fasterxml.jackson.core.JsonStreamContext.getCurrentName.

Method for accessing name associated with the current location.

public Object
getCurrentValue()

Overrides com.fasterxml.jackson.core.JsonStreamContext.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.

public int
public CBORReadContext
getParent()

Implements abstract com.fasterxml.jackson.core.JsonStreamContext.getParent.

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

public int
public JsonLocation
getStartLocation(Object
Source reference needed to construct location instance
rawSrc
)

Overrides com.fasterxml.jackson.core.JsonStreamContext.getStartLocation.

Deprecated

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

public void
public void
setCurrentValue(Object
Current value to assign to this context
v
)

Overrides com.fasterxml.jackson.core.JsonStreamContext.setCurrentValue.

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

public JsonLocation

Returns:

Location pointing to the point where the context start marker was found
startLocation
(ContentReference
Source reference needed to construct location instance
srcRef
)

Overrides com.fasterxml.jackson.core.JsonStreamContext.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 com.fasterxml.jackson.core.JsonStreamContext.toString.

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

Inherited from com.fasterxml.jackson.core.JsonStreamContext:
getCurrentIndexgetEntryCountgetNestingDepthgetTypeDeschasCurrentIndexhasCurrentNamehasPathSegmentinArrayinObjectinRootpathAsPointerpathAsPointertypeDesc

Field Detail

_childback to summary
protected CBORReadContext _child
_currentNameback to summary
protected String _currentName
_currentValueback to summary
protected Object _currentValue
Since
2.9
_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 JsonProcessingException
acceptsBreakMarkerback to summary
public boolean acceptsBreakMarker()
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)
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.

getCurrentNameback to summary
public String getCurrentName()

Implements abstract com.fasterxml.jackson.core.JsonStreamContext.getCurrentName.

Doc from com.fasterxml.jackson.core.JsonStreamContext.getCurrentName.

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

Returns:String

Current field name within context, if any; null if none

Annotations
@Override
getCurrentValueback to summary
public Object getCurrentValue()

Overrides com.fasterxml.jackson.core.JsonStreamContext.getCurrentValue.

Doc from com.fasterxml.jackson.core.JsonStreamContext.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.

Returns:Object

Currently active value, if one has been assigned.

Annotations
@Override
getExpectedLengthback to summary
public int getExpectedLength()
getParentback to summary
public CBORReadContext getParent()

Implements abstract com.fasterxml.jackson.core.JsonStreamContext.getParent.

Doc from com.fasterxml.jackson.core.JsonStreamContext.getParent.

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

Returns:CBORReadContext

Parent context of this context, if any; null for Root contexts

Annotations
@Override
getRemainingExpectedLengthback to summary
public int getRemainingExpectedLength()
getStartLocationback to summary
public JsonLocation getStartLocation(Object rawSrc)

Overrides com.fasterxml.jackson.core.JsonStreamContext.getStartLocation.

Deprecated

Parameters
rawSrc:Object

Doc from com.fasterxml.jackson.core.JsonStreamContext.getStartLocation.

Source reference needed to construct location instance

Returns:JsonLocation

Doc from com.fasterxml.jackson.core.JsonStreamContext.getStartLocation.

Location pointing to the point where the context start marker was found (or written); never null.

Annotations
@Override
@Deprecated
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 JsonProcessingException
setCurrentValueback to summary
public void setCurrentValue(Object v)

Overrides com.fasterxml.jackson.core.JsonStreamContext.setCurrentValue.

Doc from com.fasterxml.jackson.core.JsonStreamContext.setCurrentValue.

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

Parameters
v:Object

Current value to assign to this context

Annotations
@Override
startLocationback to summary
public JsonLocation startLocation(ContentReference srcRef)

Overrides com.fasterxml.jackson.core.JsonStreamContext.startLocation.

Doc from com.fasterxml.jackson.core.JsonStreamContext.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 JsonLocation#NA; this is what the default implementation does.

Parameters
srcRef:ContentReference

Source reference needed to construct location instance

Returns:JsonLocation

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

Annotations
@Override
toStringback to summary
public String toString()

Overrides com.fasterxml.jackson.core.JsonStreamContext.toString.

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

Returns:String

Doc from com.fasterxml.jackson.core.JsonStreamContext.toString.

Simple developer-readable description this context layer (note: NOT constructed with parents, unlike pathAsPointer)

Annotations
@Override