com.fasterxml.jackson.dataformat.cbor

## 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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CBORReadContext` | `_child`
    `protected String` | `_currentName`
    `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.

    - ### Fields inherited from class com.fasterxml.jackson.core.JsonStreamContext

      `_index, _type, TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CBORReadContext(CBORReadContext parent, com.fasterxml.jackson.core.json.DupDetector dups, int type, int expEntryCount)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 see if a new value is expected for this Array or Object.
    `String` | `getCurrentName()`
    `int` | `getExpectedLength()`
    `CBORReadContext` | `getParent()`
    `com.fasterxml.jackson.core.JsonLocation` | `getStartLocation(Object srcRef)`
    `boolean` | `hasExpectedLength()`
    `protected void` | `reset(int type, int expEntryCount)`
    `void` | `setCurrentName(String name)`
    `String` | `toString()` Overridden to provide developer readable "JsonPath" representation of the context.

    - ### Methods inherited from class com.fasterxml.jackson.core.JsonStreamContext

      `getCurrentIndex, getCurrentValue, getEntryCount, getTypeDesc, inArray, inObject, inRoot, setCurrentValue, typeDesc`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 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 String _currentName

    - #### _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)

    - #### 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 String getCurrentName()

      Specified by:
        `getCurrentName` in class `com.fasterxml.jackson.core.JsonStreamContext`

    - #### getParent

          public CBORReadContext getParent()

      Specified by:
        `getParent` in class `com.fasterxml.jackson.core.JsonStreamContext`

    - #### hasExpectedLength

          public boolean hasExpectedLength()

    - #### getExpectedLength

          public int getExpectedLength()

    - #### acceptsBreakMarker

          public boolean acceptsBreakMarker()

    - #### expectMoreValues

          public boolean expectMoreValues()

      Method called to see if a new value is expected for this Array or Object. Checks against expected length, if one known, updating count of current entries if limit not yet reached.

    - #### getStartLocation

          public com.fasterxml.jackson.core.JsonLocation getStartLocation(Object srcRef)

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

    - #### setCurrentName

          public void setCurrentName(String name)
                              throws com.fasterxml.jackson.core.JsonProcessingException

      Throws:
        `com.fasterxml.jackson.core.JsonProcessingException`

    - #### toString

          public String toString()

      Overridden to provide developer readable "JsonPath" representation of the context.
      Overrides:
        `toString` in class `Object`

Copyright © 2016 FasterXML. All rights reserved.