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 ofJsonReadContext
to support features needed by CBOR format.
-
-
Field Summary
Fields Modifier and Type Field Description protected CBORReadContext
_child
protected java.lang.String
_currentName
protected java.lang.Object
_currentValue
protected com.fasterxml.jackson.core.json.DupDetector
_dups
protected int
_expEntryCount
For fixed-size Arrays, Objects, this indicates expected number of entries.protected CBORReadContext
_parent
Parent context for this context; null for root context.
-
Constructor Summary
Constructors Constructor Description CBORReadContext(CBORReadContext parent, com.fasterxml.jackson.core.json.DupDetector dups, int type, int expEntryCount)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private void
_checkDup(com.fasterxml.jackson.core.json.DupDetector dd, java.lang.String name)
boolean
acceptsBreakMarker()
CBORReadContext
createChildArrayContext(int expEntryCount)
CBORReadContext
createChildObjectContext(int expEntryCount)
static CBORReadContext
createRootContext(com.fasterxml.jackson.core.json.DupDetector dups)
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.java.lang.String
getCurrentName()
java.lang.Object
getCurrentValue()
int
getExpectedLength()
CBORReadContext
getParent()
int
getRemainingExpectedLength()
com.fasterxml.jackson.core.JsonLocation
getStartLocation(java.lang.Object rawSrc)
Deprecated.boolean
hasExpectedLength()
protected void
reset(int type, int expEntryCount)
void
setCurrentName(java.lang.String name)
void
setCurrentValue(java.lang.Object v)
com.fasterxml.jackson.core.JsonLocation
startLocation(com.fasterxml.jackson.core.io.ContentReference srcRef)
java.lang.String
toString()
Overridden to provide developer readable "JsonPath" representation of the context.
-
-
-
Field Detail
-
_parent
protected final CBORReadContext _parent
Parent context for this context; null for root context.
-
_dups
protected final com.fasterxml.jackson.core.json.DupDetector _dups
-
_expEntryCount
protected int _expEntryCount
For fixed-size Arrays, Objects, this indicates expected number of entries.
-
_currentName
protected java.lang.String _currentName
-
_currentValue
protected java.lang.Object _currentValue
- Since:
- 2.9
-
_child
protected CBORReadContext _child
-
-
Constructor Detail
-
CBORReadContext
public CBORReadContext(CBORReadContext parent, com.fasterxml.jackson.core.json.DupDetector dups, int type, int expEntryCount)
-
-
Method Detail
-
reset
protected void reset(int type, int expEntryCount)
-
getCurrentValue
public java.lang.Object getCurrentValue()
- Overrides:
getCurrentValue
in classcom.fasterxml.jackson.core.JsonStreamContext
-
setCurrentValue
public void setCurrentValue(java.lang.Object v)
- Overrides:
setCurrentValue
in classcom.fasterxml.jackson.core.JsonStreamContext
-
createRootContext
public static CBORReadContext createRootContext(com.fasterxml.jackson.core.json.DupDetector dups)
-
createChildArrayContext
public CBORReadContext createChildArrayContext(int expEntryCount)
-
createChildObjectContext
public CBORReadContext createChildObjectContext(int expEntryCount)
-
getCurrentName
public java.lang.String getCurrentName()
- Specified by:
getCurrentName
in classcom.fasterxml.jackson.core.JsonStreamContext
-
getParent
public CBORReadContext 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 public com.fasterxml.jackson.core.JsonLocation getStartLocation(java.lang.Object rawSrc)
Deprecated.- Overrides:
getStartLocation
in classcom.fasterxml.jackson.core.JsonStreamContext
-
setCurrentName
public void setCurrentName(java.lang.String name) throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
_checkDup
private void _checkDup(com.fasterxml.jackson.core.json.DupDetector dd, java.lang.String name) throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
toString
public java.lang.String toString()
Overridden to provide developer readable "JsonPath" representation of the context.- Overrides:
toString
in classcom.fasterxml.jackson.core.JsonStreamContext
-
-