Class JsonReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, org.bson.BsonReader

    public class JsonReader
    extends org.bson.AbstractBsonReader
    A simplified fork of JsonReader that works with readers and removes processing related to MongoDB
    Since:
    6.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  JsonReader.Context  
      protected class  JsonReader.Mark  
      • Nested classes/interfaces inherited from class org.bson.AbstractBsonReader

        org.bson.AbstractBsonReader.State
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonReader​(java.io.Reader reader)
      Constructs a new instance with the given JSON reader.
      JsonReader​(java.lang.String json)
      Constructs a new instance with the given JSON string.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int doPeekBinarySize()  
      protected byte doPeekBinarySubType()  
      protected org.bson.BsonBinary doReadBinaryData()  
      protected boolean doReadBoolean()  
      protected long doReadDateTime()  
      protected org.bson.BsonDbPointer doReadDBPointer()  
      protected org.bson.types.Decimal128 doReadDecimal128()  
      protected double doReadDouble()  
      protected void doReadEndArray()  
      protected void doReadEndDocument()  
      protected int doReadInt32()  
      protected long doReadInt64()  
      protected java.lang.String doReadJavaScript()  
      protected java.lang.String doReadJavaScriptWithScope()  
      protected void doReadMaxKey()  
      protected void doReadMinKey()  
      protected void doReadNull()  
      protected org.bson.types.ObjectId doReadObjectId()  
      protected org.bson.BsonRegularExpression doReadRegularExpression()  
      protected void doReadStartArray()  
      protected void doReadStartDocument()  
      protected java.lang.String doReadString()  
      protected java.lang.String doReadSymbol()  
      protected org.bson.BsonTimestamp doReadTimestamp()  
      protected void doReadUndefined()  
      protected void doSkipName()  
      protected void doSkipValue()  
      protected JsonReader.Context getContext()  
      org.bson.BsonReaderMark getMark()  
      org.bson.BsonType readBsonType()  
      • Methods inherited from class org.bson.AbstractBsonReader

        checkPreconditions, close, getCurrentBsonType, getCurrentName, getNextState, getState, isClosed, peekBinarySize, peekBinarySubType, readBinaryData, readBinaryData, readBoolean, readBoolean, readDateTime, readDateTime, readDBPointer, readDBPointer, readDecimal128, readDecimal128, readDouble, readDouble, readEndArray, readEndDocument, readInt32, readInt32, readInt64, readInt64, readJavaScript, readJavaScript, readJavaScriptWithScope, readJavaScriptWithScope, readMaxKey, readMaxKey, readMinKey, readMinKey, readName, readName, readNull, readNull, readObjectId, readObjectId, readRegularExpression, readRegularExpression, readStartArray, readStartDocument, readString, readString, readSymbol, readSymbol, readTimestamp, readTimestamp, readUndefined, readUndefined, setContext, setCurrentBsonType, setCurrentName, setState, skipName, skipValue, throwInvalidContextType, throwInvalidState, verifyBSONType, verifyName
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonReader

        public JsonReader​(java.lang.String json)
        Constructs a new instance with the given JSON string.
        Parameters:
        json - A string representation of a JSON.
      • JsonReader

        public JsonReader​(java.io.Reader reader)
        Constructs a new instance with the given JSON reader.
        Parameters:
        reader - The reader.
    • Method Detail

      • doReadBinaryData

        protected org.bson.BsonBinary doReadBinaryData()
        Specified by:
        doReadBinaryData in class org.bson.AbstractBsonReader
      • doPeekBinarySubType

        protected byte doPeekBinarySubType()
        Specified by:
        doPeekBinarySubType in class org.bson.AbstractBsonReader
      • doPeekBinarySize

        protected int doPeekBinarySize()
        Specified by:
        doPeekBinarySize in class org.bson.AbstractBsonReader
      • doReadBoolean

        protected boolean doReadBoolean()
        Specified by:
        doReadBoolean in class org.bson.AbstractBsonReader
      • readBsonType

        public org.bson.BsonType readBsonType()
        Specified by:
        readBsonType in interface org.bson.BsonReader
        Specified by:
        readBsonType in class org.bson.AbstractBsonReader
      • doReadDateTime

        protected long doReadDateTime()
        Specified by:
        doReadDateTime in class org.bson.AbstractBsonReader
      • doReadDouble

        protected double doReadDouble()
        Specified by:
        doReadDouble in class org.bson.AbstractBsonReader
      • doReadEndArray

        protected void doReadEndArray()
        Specified by:
        doReadEndArray in class org.bson.AbstractBsonReader
      • doReadEndDocument

        protected void doReadEndDocument()
        Specified by:
        doReadEndDocument in class org.bson.AbstractBsonReader
      • doReadInt32

        protected int doReadInt32()
        Specified by:
        doReadInt32 in class org.bson.AbstractBsonReader
      • doReadInt64

        protected long doReadInt64()
        Specified by:
        doReadInt64 in class org.bson.AbstractBsonReader
      • doReadDecimal128

        protected org.bson.types.Decimal128 doReadDecimal128()
        Specified by:
        doReadDecimal128 in class org.bson.AbstractBsonReader
      • doReadJavaScript

        protected java.lang.String doReadJavaScript()
        Specified by:
        doReadJavaScript in class org.bson.AbstractBsonReader
      • doReadJavaScriptWithScope

        protected java.lang.String doReadJavaScriptWithScope()
        Specified by:
        doReadJavaScriptWithScope in class org.bson.AbstractBsonReader
      • doReadMaxKey

        protected void doReadMaxKey()
        Specified by:
        doReadMaxKey in class org.bson.AbstractBsonReader
      • doReadMinKey

        protected void doReadMinKey()
        Specified by:
        doReadMinKey in class org.bson.AbstractBsonReader
      • doReadNull

        protected void doReadNull()
        Specified by:
        doReadNull in class org.bson.AbstractBsonReader
      • doReadObjectId

        protected org.bson.types.ObjectId doReadObjectId()
        Specified by:
        doReadObjectId in class org.bson.AbstractBsonReader
      • doReadRegularExpression

        protected org.bson.BsonRegularExpression doReadRegularExpression()
        Specified by:
        doReadRegularExpression in class org.bson.AbstractBsonReader
      • doReadDBPointer

        protected org.bson.BsonDbPointer doReadDBPointer()
        Specified by:
        doReadDBPointer in class org.bson.AbstractBsonReader
      • doReadStartArray

        protected void doReadStartArray()
        Specified by:
        doReadStartArray in class org.bson.AbstractBsonReader
      • doReadStartDocument

        protected void doReadStartDocument()
        Specified by:
        doReadStartDocument in class org.bson.AbstractBsonReader
      • doReadString

        protected java.lang.String doReadString()
        Specified by:
        doReadString in class org.bson.AbstractBsonReader
      • doReadSymbol

        protected java.lang.String doReadSymbol()
        Specified by:
        doReadSymbol in class org.bson.AbstractBsonReader
      • doReadTimestamp

        protected org.bson.BsonTimestamp doReadTimestamp()
        Specified by:
        doReadTimestamp in class org.bson.AbstractBsonReader
      • doReadUndefined

        protected void doReadUndefined()
        Specified by:
        doReadUndefined in class org.bson.AbstractBsonReader
      • doSkipName

        protected void doSkipName()
        Specified by:
        doSkipName in class org.bson.AbstractBsonReader
      • doSkipValue

        protected void doSkipValue()
        Specified by:
        doSkipValue in class org.bson.AbstractBsonReader
      • getMark

        public org.bson.BsonReaderMark getMark()
      • getContext

        protected JsonReader.Context getContext()
        Overrides:
        getContext in class org.bson.AbstractBsonReader