Class CBORReadContext
java.lang.Object
tools.jackson.core.TokenStreamContext
tools.jackson.dataformat.cbor.CBORReadContext
public final class CBORReadContext
extends tools.jackson.core.TokenStreamContext
Extension of
TokenStreamContext
to support features needed by CBOR format (mainly limits of expected
entries to output).-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CBORReadContextprotected Stringprotected Objectprotected final tools.jackson.core.json.DupDetectorprotected intFor fixed-size Arrays, Objects, this indicates expected number of entries.protected final CBORReadContextParent context for this context; null for root context.Fields inherited from class tools.jackson.core.TokenStreamContext
_index, _nestingDepth, _type, TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT -
Constructor Summary
ConstructorsConstructorDescriptionCBORReadContext(CBORReadContext parent, tools.jackson.core.json.DupDetector dups, int type, int expEntryCount) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbooleanvoidcreateChildArrayContext(int expEntryCount) createChildObjectContext(int expEntryCount) static CBORReadContextcreateRootContext(tools.jackson.core.json.DupDetector dups) booleanMethod 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.intintbooleanprotected voidreset(int type, int expEntryCount) voidsetCurrentName(String name) tools.jackson.core.TokenStreamLocationstartLocation(tools.jackson.core.io.ContentReference srcRef) toString()Overridden to provide developer readable "JsonPath" representation of the context.Methods inherited from class tools.jackson.core.TokenStreamContext
getCurrentIndex, getEntryCount, getNestingDepth, hasCurrentIndex, hasCurrentName, hasPathSegment, inArray, inObject, inRoot, pathAsPointer, pathAsPointer, typeDesc
-
Field Details
-
_parent
Parent context for this context; null for root context. -
_dups
protected final tools.jackson.core.json.DupDetector _dups -
_expEntryCount
protected int _expEntryCountFor fixed-size Arrays, Objects, this indicates expected number of entries. -
_currentName
-
_currentValue
-
_child
-
-
Constructor Details
-
CBORReadContext
public CBORReadContext(CBORReadContext parent, tools.jackson.core.json.DupDetector dups, int type, int expEntryCount)
-
-
Method Details
-
reset
protected void reset(int type, int expEntryCount) -
currentValue
- Overrides:
currentValuein classtools.jackson.core.TokenStreamContext
-
assignCurrentValue
- Overrides:
assignCurrentValuein classtools.jackson.core.TokenStreamContext
-
createRootContext
-
createChildArrayContext
-
createChildObjectContext
-
currentName
- Specified by:
currentNamein classtools.jackson.core.TokenStreamContext
-
getParent
- Specified by:
getParentin classtools.jackson.core.TokenStreamContext
-
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 tools.jackson.core.TokenStreamLocation startLocation(tools.jackson.core.io.ContentReference srcRef) - Overrides:
startLocationin classtools.jackson.core.TokenStreamContext- Returns:
- Location pointing to the point where the context start marker was found
-
setCurrentName
- Throws:
tools.jackson.core.exc.StreamReadException
-
_checkDup
private void _checkDup(tools.jackson.core.json.DupDetector dd, String name) throws tools.jackson.core.exc.StreamReadException - Throws:
tools.jackson.core.exc.StreamReadException
-
toString
Overridden to provide developer readable "JsonPath" representation of the context.- Overrides:
toStringin classtools.jackson.core.TokenStreamContext
-