Class DocumentObjectTraversingParser

java.lang.Object
tools.jackson.core.JsonParser
tools.jackson.core.base.ParserMinimalBase
org.mongojack.internal.object.document.DocumentObjectTraversingParser
All Implemented Interfaces:
Closeable, AutoCloseable, tools.jackson.core.Versioned

public class DocumentObjectTraversingParser extends tools.jackson.core.base.ParserMinimalBase
Parses a BSONObject by traversing it. This class was copied from TreeTraversingParser and then adapted to be for BSONObject's, rather than JsonNode's. While decoding by the cursor uses DBDecoderBsonParser, there are still things that need to be decoded from the DBObjects, including the result of findAndModify, and saved objects after saving.
Since:
1.0
Author:
James Roper
  • Nested Class Summary

    Nested classes/interfaces inherited from class tools.jackson.core.JsonParser

    tools.jackson.core.JsonParser.NumberType, tools.jackson.core.JsonParser.NumberTypeFP
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    Flag that indicates whether parser is closed or not.
    protected tools.jackson.core.JsonToken
    Sometimes parser needs to buffer a single look-ahead token; if so, it'll be stored here.
    protected org.mongojack.internal.object.document.DocumentObjectCursor
    Traversal context within tree
    protected boolean
    Flag needed to handle recursion into contents of child Array/Object nodes.

    Fields inherited from class tools.jackson.core.base.ParserMinimalBase

    _closed, _currToken, _ioContext, _lastClearedToken, _objectReadContext, _streamReadConstraints, _streamReadFeatures, _tokenCount, _trackMaxTokenCount, BD_MAX_INT, BD_MAX_LONG, BD_MIN_INT, BD_MIN_LONG, BI_MAX_INT, BI_MAX_LONG, BI_MIN_INT, BI_MIN_LONG, CHAR_NULL, INT_0, INT_9, INT_APOS, INT_ASTERISK, INT_BACKSLASH, INT_COLON, INT_COMMA, INT_CR, INT_e, INT_E, INT_HASH, INT_LBRACKET, INT_LCURLY, INT_LF, INT_MINUS, INT_PERIOD, INT_PLUS, INT_QUOTE, INT_RBRACKET, INT_RCURLY, INT_RS, INT_SLASH, INT_SPACE, INT_TAB, MAX_BYTE_I, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MAX_SHORT_I, MIN_BYTE_I, MIN_INT_D, MIN_INT_L, MIN_LONG_D, MIN_SHORT_I, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN, STREAM_READ_FEATURE_DEFAULTS

    Fields inherited from class tools.jackson.core.JsonParser

    DEFAULT_READ_CAPABILITIES
  • Constructor Summary

    Constructors
    Constructor
    Description
    DocumentObjectTraversingParser(Object rootValue, tools.jackson.core.ObjectReadContext readContext, tools.jackson.core.io.IOContext ioContext)
     
    DocumentObjectTraversingParser(org.bson.Document o, tools.jackson.core.ObjectReadContext readContext, tools.jackson.core.io.IOContext ioContext)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected void
     
    protected void
     
    void
     
    void
     
    tools.jackson.core.TokenStreamLocation
     
     
    protected Object
     
    tools.jackson.core.TokenStreamLocation
     
     
     
    byte[]
    getBinaryValue(tools.jackson.core.Base64Variant b64variant)
     
     
    double
     
     
    float
     
    int
     
    long
     
    tools.jackson.core.JsonParser.NumberType
     
     
     
    char[]
     
    int
     
    int
     
     
    char[]
     
    int
     
    int
     
    boolean
     
    boolean
     
    boolean
     
    tools.jackson.core.JsonToken
     
    tools.jackson.core.JsonParser
     
    tools.jackson.core.TokenStreamContext
     
     
    tools.jackson.core.Version
     

    Methods inherited from class tools.jackson.core.base.ParserMinimalBase

    _constructInputCoercion, _constructNotNumericType, _currentLocationMinusOne, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _nullSafeUpdateToken, _reportBadInputStream, _reportBadReader, _reportError, _reportError, _reportError, _reportError, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidNumber, _reportInvalidSpace, _reportInvalidUTF8Surrogate, _reportMissingRootWS, _reportOverflowByte, _reportOverflowInt, _reportOverflowInt, _reportOverflowInt, _reportOverflowLong, _reportOverflowLong, _reportOverflowLong, _reportOverflowShort, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _updateToken, _updateTokenToNA, _updateTokenToNull, _wrapIOFailure, clearCurrentToken, currentNameMatch, currentToken, currentTokenCount, currentTokenId, finishToken, getBooleanValue, getByteValue, getLastClearedToken, getNumberTypeFP, getNumberValueDeferred, getNumberValueExact, getShortValue, getString, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isEnabled, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextName, nextName, nextNameMatch, nextValue, objectReadContext, readValueAs, readValueAs, readValueAs, readValueAsTree, streamReadCapabilities, streamReadConstraints, streamReadFeatures

    Methods inherited from class tools.jackson.core.JsonParser

    _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, canParseAsync, canReadObjectId, canReadTypeId, getBinaryValue, getObjectId, getSchema, getTypeId, getValueAsBoolean, getValueAsDouble, nextBooleanValue, nextIntValue, nextLongValue, nextNameMatchAndToken, nextStringValue, nonBlockingInputFeeder, readBinaryValue, readBinaryValue, readString, releaseBuffered, releaseBuffered, willInternPropertyNames

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • nodeCursor

      protected org.mongojack.internal.object.document.DocumentObjectCursor nodeCursor
      Traversal context within tree
    • nextToken

      protected tools.jackson.core.JsonToken nextToken
      Sometimes parser needs to buffer a single look-ahead token; if so, it'll be stored here. This is currently used for handling
    • startContainer

      protected boolean startContainer
      Flag needed to handle recursion into contents of child Array/Object nodes.
    • closed

      protected boolean closed
      Flag that indicates whether parser is closed or not. Gets set when parser is either closed by explicit call (close()) or when end-of-input is reached.
  • Constructor Details

    • DocumentObjectTraversingParser

      public DocumentObjectTraversingParser(Object rootValue, tools.jackson.core.ObjectReadContext readContext, tools.jackson.core.io.IOContext ioContext)
    • DocumentObjectTraversingParser

      public DocumentObjectTraversingParser(org.bson.Document o, tools.jackson.core.ObjectReadContext readContext, tools.jackson.core.io.IOContext ioContext)
  • Method Details

    • version

      public tools.jackson.core.Version version()
      Specified by:
      version in interface tools.jackson.core.Versioned
      Specified by:
      version in class tools.jackson.core.JsonParser
    • close

      public void close() throws tools.jackson.core.JacksonException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • nextToken

      public tools.jackson.core.JsonToken nextToken() throws tools.jackson.core.JacksonException
      Specified by:
      nextToken in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • skipChildren

      public tools.jackson.core.JsonParser skipChildren() throws tools.jackson.core.JacksonException
      Overrides:
      skipChildren in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • isClosed

      public boolean isClosed()
      Overrides:
      isClosed in class tools.jackson.core.base.ParserMinimalBase
    • currentName

      public String currentName()
      Specified by:
      currentName in class tools.jackson.core.JsonParser
    • streamReadContext

      public tools.jackson.core.TokenStreamContext streamReadContext()
      Specified by:
      streamReadContext in class tools.jackson.core.JsonParser
    • currentTokenLocation

      public tools.jackson.core.TokenStreamLocation currentTokenLocation()
      Specified by:
      currentTokenLocation in class tools.jackson.core.JsonParser
    • currentLocation

      public tools.jackson.core.TokenStreamLocation currentLocation()
      Specified by:
      currentLocation in class tools.jackson.core.JsonParser
    • getText

      public String getText()
      Overrides:
      getText in class tools.jackson.core.JsonParser
    • getTextCharacters

      public char[] getTextCharacters() throws tools.jackson.core.JacksonException
      Overrides:
      getTextCharacters in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getTextLength

      public int getTextLength() throws tools.jackson.core.JacksonException
      Overrides:
      getTextLength in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getTextOffset

      public int getTextOffset() throws tools.jackson.core.JacksonException
      Overrides:
      getTextOffset in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getNumberType

      public tools.jackson.core.JsonParser.NumberType getNumberType() throws tools.jackson.core.JacksonException
      Specified by:
      getNumberType in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getBigIntegerValue

      public BigInteger getBigIntegerValue() throws tools.jackson.core.JacksonException
      Specified by:
      getBigIntegerValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getDecimalValue

      public BigDecimal getDecimalValue() throws tools.jackson.core.JacksonException
      Specified by:
      getDecimalValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getDoubleValue

      public double getDoubleValue() throws tools.jackson.core.JacksonException
      Specified by:
      getDoubleValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getFloatValue

      public float getFloatValue() throws tools.jackson.core.JacksonException
      Specified by:
      getFloatValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getLongValue

      public long getLongValue() throws tools.jackson.core.JacksonException
      Specified by:
      getLongValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getIntValue

      public int getIntValue() throws tools.jackson.core.JacksonException
      Specified by:
      getIntValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getNumberValue

      public Number getNumberValue() throws tools.jackson.core.JacksonException
      Specified by:
      getNumberValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getBinaryValue

      public byte[] getBinaryValue(tools.jackson.core.Base64Variant b64variant) throws tools.jackson.core.JacksonException
      Specified by:
      getBinaryValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getEmbeddedObject

      public Object getEmbeddedObject() throws tools.jackson.core.JacksonException
      Overrides:
      getEmbeddedObject in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • _handleEOF

      protected void _handleEOF() throws tools.jackson.core.exc.StreamReadException
      Specified by:
      _handleEOF in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.exc.StreamReadException
    • currentNode

      protected Object currentNode()
    • _closeInput

      protected void _closeInput() throws IOException
      Specified by:
      _closeInput in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      IOException
    • _releaseBuffers

      protected void _releaseBuffers()
      Specified by:
      _releaseBuffers in class tools.jackson.core.base.ParserMinimalBase
    • streamReadInputSource

      public Object streamReadInputSource()
      Specified by:
      streamReadInputSource in class tools.jackson.core.JsonParser
    • currentValue

      public Object currentValue()
      Specified by:
      currentValue in class tools.jackson.core.JsonParser
    • assignCurrentValue

      public void assignCurrentValue(Object v)
      Specified by:
      assignCurrentValue in class tools.jackson.core.JsonParser
    • isNaN

      public boolean isNaN()
      Specified by:
      isNaN in class tools.jackson.core.JsonParser
    • getString

      public String getString() throws tools.jackson.core.JacksonException
      Specified by:
      getString in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getStringCharacters

      public char[] getStringCharacters() throws tools.jackson.core.JacksonException
      Specified by:
      getStringCharacters in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getStringLength

      public int getStringLength() throws tools.jackson.core.JacksonException
      Specified by:
      getStringLength in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getStringOffset

      public int getStringOffset() throws tools.jackson.core.JacksonException
      Specified by:
      getStringOffset in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • hasStringCharacters

      public boolean hasStringCharacters()
      Specified by:
      hasStringCharacters in class tools.jackson.core.JsonParser