Class CBORReadContext
java.lang.Object
com.fasterxml.jackson.core.JsonStreamContext
com.fasterxml.jackson.dataformat.cbor.CBORReadContext
public final class CBORReadContext
extends com.fasterxml.jackson.core.JsonStreamContext
Replacement of
JsonReadContext
to support features needed by CBOR format.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CBORReadContext
protected String
protected Object
protected final com.fasterxml.jackson.core.json.DupDetector
protected int
For fixed-size Arrays, Objects, this indicates expected number of entries.protected final CBORReadContext
Parent context for this context; null for root context.Fields inherited from class com.fasterxml.jackson.core.JsonStreamContext
_index, _nestingDepth, _type, TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT
-
Constructor Summary
ConstructorsConstructorDescriptionCBORReadContext
(CBORReadContext parent, com.fasterxml.jackson.core.json.DupDetector dups, int type, int expEntryCount) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
boolean
createChildArrayContext
(int expEntryCount) createChildObjectContext
(int expEntryCount) static CBORReadContext
createRootContext
(com.fasterxml.jackson.core.json.DupDetector dups) boolean
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.int
int
com.fasterxml.jackson.core.JsonLocation
getStartLocation
(Object rawSrc) Deprecated.boolean
protected void
reset
(int type, int expEntryCount) void
setCurrentName
(String name) void
com.fasterxml.jackson.core.JsonLocation
startLocation
(com.fasterxml.jackson.core.io.ContentReference srcRef) toString()
Overridden to provide developer readable "JsonPath" representation of the context.Methods inherited from class com.fasterxml.jackson.core.JsonStreamContext
getCurrentIndex, getEntryCount, getNestingDepth, getTypeDesc, hasCurrentIndex, hasCurrentName, hasPathSegment, inArray, inObject, inRoot, pathAsPointer, pathAsPointer, typeDesc
-
Field Details
-
_parent
Parent context for this context; null for root context. -
_dups
protected final com.fasterxml.jackson.core.json.DupDetector _dups -
_expEntryCount
protected int _expEntryCountFor fixed-size Arrays, Objects, this indicates expected number of entries. -
_currentName
-
_currentValue
- Since:
- 2.9
-
_child
-
-
Constructor Details
-
CBORReadContext
public CBORReadContext(CBORReadContext parent, com.fasterxml.jackson.core.json.DupDetector dups, int type, int expEntryCount)
-
-
Method Details
-
reset
protected void reset(int type, int expEntryCount) -
getCurrentValue
- Overrides:
getCurrentValue
in classcom.fasterxml.jackson.core.JsonStreamContext
-
setCurrentValue
- Overrides:
setCurrentValue
in classcom.fasterxml.jackson.core.JsonStreamContext
-
createRootContext
-
createChildArrayContext
-
createChildObjectContext
-
getCurrentName
- Specified by:
getCurrentName
in classcom.fasterxml.jackson.core.JsonStreamContext
-
getParent
- Specified by:
getParent
in classcom.fasterxml.jackson.core.JsonStreamContext
-
hasExpectedLength
public boolean hasExpectedLength() -
getExpectedLength
public int getExpectedLength() -
getRemainingExpectedLength
public int getRemainingExpectedLength() -
acceptsBreakMarker
public boolean acceptsBreakMarker() -
expectMoreValues
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.
-
startLocation
public com.fasterxml.jackson.core.JsonLocation startLocation(com.fasterxml.jackson.core.io.ContentReference srcRef) - Overrides:
startLocation
in classcom.fasterxml.jackson.core.JsonStreamContext
- Returns:
- Location pointing to the point where the context start marker was found
-
getStartLocation
Deprecated.- Overrides:
getStartLocation
in classcom.fasterxml.jackson.core.JsonStreamContext
-
setCurrentName
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
_checkDup
private void _checkDup(com.fasterxml.jackson.core.json.DupDetector dd, String name) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
toString
Overridden to provide developer readable "JsonPath" representation of the context.- Overrides:
toString
in classcom.fasterxml.jackson.core.JsonStreamContext
-