Class DocumentReader

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

    public class DocumentReader
    extends Object
    implements org.bson.BsonReader
    Developer note.
    This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
    • Constructor Detail

      • DocumentReader

        public DocumentReader​(org.bson.Document document)
        Construct a new instance.
        Parameters:
        document - the document to read from
    • Method Detail

      • currentState

        public dev.morphia.mapping.codec.reader.ReaderState currentState()
        Returns:
        the current state of the reader
      • getCurrentBsonType

        public org.bson.BsonType getCurrentBsonType()
        Specified by:
        getCurrentBsonType in interface org.bson.BsonReader
      • getCurrentName

        public String getCurrentName()
        Specified by:
        getCurrentName in interface org.bson.BsonReader
      • readBinaryData

        public org.bson.BsonBinary readBinaryData()
        Specified by:
        readBinaryData in interface org.bson.BsonReader
      • peekBinarySubType

        public byte peekBinarySubType()
        Specified by:
        peekBinarySubType in interface org.bson.BsonReader
      • peekBinarySize

        public int peekBinarySize()
        Specified by:
        peekBinarySize in interface org.bson.BsonReader
      • readBinaryData

        public org.bson.BsonBinary readBinaryData​(String name)
        Specified by:
        readBinaryData in interface org.bson.BsonReader
      • readBoolean

        public boolean readBoolean()
        Specified by:
        readBoolean in interface org.bson.BsonReader
      • readBoolean

        public boolean readBoolean​(String name)
        Specified by:
        readBoolean in interface org.bson.BsonReader
      • readBsonType

        public org.bson.BsonType readBsonType()
        Specified by:
        readBsonType in interface org.bson.BsonReader
      • readDateTime

        public long readDateTime()
        Specified by:
        readDateTime in interface org.bson.BsonReader
      • readDateTime

        public long readDateTime​(String name)
        Specified by:
        readDateTime in interface org.bson.BsonReader
      • readDouble

        public double readDouble()
        Specified by:
        readDouble in interface org.bson.BsonReader
      • readDouble

        public double readDouble​(String name)
        Specified by:
        readDouble in interface org.bson.BsonReader
      • readEndArray

        public void readEndArray()
        Specified by:
        readEndArray in interface org.bson.BsonReader
      • readEndDocument

        public void readEndDocument()
        Specified by:
        readEndDocument in interface org.bson.BsonReader
      • readInt32

        public int readInt32()
        Specified by:
        readInt32 in interface org.bson.BsonReader
      • readInt32

        public int readInt32​(String name)
        Specified by:
        readInt32 in interface org.bson.BsonReader
      • readInt64

        public long readInt64()
        Specified by:
        readInt64 in interface org.bson.BsonReader
      • readInt64

        public long readInt64​(String name)
        Specified by:
        readInt64 in interface org.bson.BsonReader
      • readDecimal128

        public org.bson.types.Decimal128 readDecimal128()
        Specified by:
        readDecimal128 in interface org.bson.BsonReader
      • readDecimal128

        public org.bson.types.Decimal128 readDecimal128​(String name)
        Specified by:
        readDecimal128 in interface org.bson.BsonReader
      • readJavaScript

        public String readJavaScript()
        Specified by:
        readJavaScript in interface org.bson.BsonReader
      • readJavaScript

        public String readJavaScript​(String name)
        Specified by:
        readJavaScript in interface org.bson.BsonReader
      • readJavaScriptWithScope

        public String readJavaScriptWithScope()
        Specified by:
        readJavaScriptWithScope in interface org.bson.BsonReader
      • readJavaScriptWithScope

        public String readJavaScriptWithScope​(String name)
        Specified by:
        readJavaScriptWithScope in interface org.bson.BsonReader
      • readMaxKey

        public void readMaxKey()
        Specified by:
        readMaxKey in interface org.bson.BsonReader
      • readMaxKey

        public void readMaxKey​(String name)
        Specified by:
        readMaxKey in interface org.bson.BsonReader
      • readMinKey

        public void readMinKey()
        Specified by:
        readMinKey in interface org.bson.BsonReader
      • readMinKey

        public void readMinKey​(String name)
        Specified by:
        readMinKey in interface org.bson.BsonReader
      • readName

        public String readName()
        Specified by:
        readName in interface org.bson.BsonReader
      • readName

        public void readName​(String name)
        Specified by:
        readName in interface org.bson.BsonReader
      • readNull

        public void readNull()
        Specified by:
        readNull in interface org.bson.BsonReader
      • readNull

        public void readNull​(String name)
        Specified by:
        readNull in interface org.bson.BsonReader
      • readObjectId

        public org.bson.types.ObjectId readObjectId()
        Specified by:
        readObjectId in interface org.bson.BsonReader
      • readObjectId

        public org.bson.types.ObjectId readObjectId​(String name)
        Specified by:
        readObjectId in interface org.bson.BsonReader
      • readRegularExpression

        public org.bson.BsonRegularExpression readRegularExpression()
        Specified by:
        readRegularExpression in interface org.bson.BsonReader
      • readRegularExpression

        public org.bson.BsonRegularExpression readRegularExpression​(String name)
        Specified by:
        readRegularExpression in interface org.bson.BsonReader
      • readDBPointer

        public org.bson.BsonDbPointer readDBPointer()
        Specified by:
        readDBPointer in interface org.bson.BsonReader
      • readDBPointer

        public org.bson.BsonDbPointer readDBPointer​(String name)
        Specified by:
        readDBPointer in interface org.bson.BsonReader
      • readStartArray

        public void readStartArray()
        Specified by:
        readStartArray in interface org.bson.BsonReader
      • readStartDocument

        public void readStartDocument()
        Specified by:
        readStartDocument in interface org.bson.BsonReader
      • readString

        public String readString()
        Specified by:
        readString in interface org.bson.BsonReader
      • readString

        public String readString​(String name)
        Specified by:
        readString in interface org.bson.BsonReader
      • readSymbol

        public String readSymbol()
        Specified by:
        readSymbol in interface org.bson.BsonReader
      • readSymbol

        public String readSymbol​(String name)
        Specified by:
        readSymbol in interface org.bson.BsonReader
      • readTimestamp

        public org.bson.BsonTimestamp readTimestamp()
        Specified by:
        readTimestamp in interface org.bson.BsonReader
      • readTimestamp

        public org.bson.BsonTimestamp readTimestamp​(String name)
        Specified by:
        readTimestamp in interface org.bson.BsonReader
      • readUndefined

        public void readUndefined()
        Specified by:
        readUndefined in interface org.bson.BsonReader
      • readUndefined

        public void readUndefined​(String name)
        Specified by:
        readUndefined in interface org.bson.BsonReader
      • skipName

        public void skipName()
        Specified by:
        skipName in interface org.bson.BsonReader
      • skipValue

        public void skipValue()
        Specified by:
        skipValue in interface org.bson.BsonReader
      • getMark

        public org.bson.BsonReaderMark getMark()
        Specified by:
        getMark in interface org.bson.BsonReader
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface org.bson.BsonReader
        Specified by:
        close in interface Closeable
      • verifyName

        protected void verifyName​(String expectedName)