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 Details

    • _parent

      protected final CBORReadContext _parent
      Parent context for this context; null for root context.
    • _dups

      protected final tools.jackson.core.json.DupDetector _dups
    • _expEntryCount

      protected int _expEntryCount
      For fixed-size Arrays, Objects, this indicates expected number of entries.
    • _currentName

      protected String _currentName
    • _currentValue

      protected Object _currentValue
    • _child

      protected CBORReadContext _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

      public Object currentValue()
      Overrides:
      currentValue in class tools.jackson.core.TokenStreamContext
    • assignCurrentValue

      public void assignCurrentValue(Object v)
      Overrides:
      assignCurrentValue in class tools.jackson.core.TokenStreamContext
    • createRootContext

      public static CBORReadContext createRootContext(tools.jackson.core.json.DupDetector dups)
    • createChildArrayContext

      public CBORReadContext createChildArrayContext(int expEntryCount)
    • createChildObjectContext

      public CBORReadContext createChildObjectContext(int expEntryCount)
    • currentName

      public String currentName()
      Specified by:
      currentName in class tools.jackson.core.TokenStreamContext
    • getParent

      public CBORReadContext getParent()
      Specified by:
      getParent in class tools.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:
      startLocation in class tools.jackson.core.TokenStreamContext
      Returns:
      Location pointing to the point where the context start marker was found
    • setCurrentName

      public void setCurrentName(String name) throws tools.jackson.core.exc.StreamReadException
      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

      public String toString()
      Overridden to provide developer readable "JsonPath" representation of the context.
      Overrides:
      toString in class tools.jackson.core.TokenStreamContext