public class BsonDocumentReader extends AbstractBsonReader
BsonReader
implementation that reads from an instance of BsonDocument
. This can be used to decode a BsonDocument
using a Decoder
.BsonDocument
,
Decoder
Modifier and Type | Class and Description |
---|---|
protected class |
BsonDocumentReader.Context |
protected class |
BsonDocumentReader.Mark |
AbstractBsonReader.State
Constructor and Description |
---|
BsonDocumentReader(BsonDocument document)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected int |
doPeekBinarySize()
Handles the logic to peek at the binary size.
|
protected byte |
doPeekBinarySubType()
Handles the logic to peek at the binary subtype.
|
protected BsonBinary |
doReadBinaryData()
Handles the logic to read binary data
|
protected boolean |
doReadBoolean()
Handles the logic to read booleans
|
protected long |
doReadDateTime()
Handles the logic to read date time
|
protected BsonDbPointer |
doReadDBPointer()
Handles the logic to read a DBPointer
|
Decimal128 |
doReadDecimal128()
Handles the logic to read Decimal128
|
protected double |
doReadDouble()
Handles the logic to read doubles
|
protected void |
doReadEndArray()
Handles the logic when reading the end of an array
|
protected void |
doReadEndDocument()
Handles the logic when reading the end of a document
|
protected int |
doReadInt32()
Handles the logic to read 32 bit ints
|
protected long |
doReadInt64()
Handles the logic to read 64 bit ints
|
protected String |
doReadJavaScript()
Handles the logic to read Javascript functions
|
protected String |
doReadJavaScriptWithScope()
Handles the logic to read scoped Javascript functions
|
protected void |
doReadMaxKey()
Handles the logic to read a Max key
|
protected void |
doReadMinKey()
Handles the logic to read a Min key
|
protected void |
doReadNull()
Handles the logic to read a null value
|
protected ObjectId |
doReadObjectId()
Handles the logic to read an ObjectId
|
protected BsonRegularExpression |
doReadRegularExpression()
Handles the logic to read a regular expression
|
protected void |
doReadStartArray()
Handles the logic to read the start of an array
|
protected void |
doReadStartDocument()
Handles the logic to read the start of a document
|
protected String |
doReadString()
Handles the logic to read a String
|
protected String |
doReadSymbol()
Handles the logic to read a Symbol
|
protected BsonTimestamp |
doReadTimestamp()
Handles the logic to read a timestamp
|
protected void |
doReadUndefined()
Handles the logic to read an Undefined value
|
protected void |
doSkipName()
Handles any logic required to skip the name (reader must be positioned on a name).
|
protected void |
doSkipValue()
Handles any logic required to skip the value (reader must be positioned on a value).
|
protected BsonDocumentReader.Context |
getContext()
Get the context, which will indicate which state the reader is in, for example which part of a document it's currently reading.
|
BsonReaderMark |
getMark()
Gets a mark representing the current state of the reader.
|
void |
mark()
Deprecated.
|
BsonType |
readBsonType()
Reads a BSONType from the reader.
|
void |
reset()
Go back to the state at the last mark and removes the mark
|
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
public BsonDocumentReader(BsonDocument document)
document
- the document to read fromprotected BsonBinary doReadBinaryData()
AbstractBsonReader
doReadBinaryData
in class AbstractBsonReader
protected byte doPeekBinarySubType()
AbstractBsonReader
doPeekBinarySubType
in class AbstractBsonReader
protected int doPeekBinarySize()
AbstractBsonReader
doPeekBinarySize
in class AbstractBsonReader
protected boolean doReadBoolean()
AbstractBsonReader
doReadBoolean
in class AbstractBsonReader
protected long doReadDateTime()
AbstractBsonReader
doReadDateTime
in class AbstractBsonReader
protected double doReadDouble()
AbstractBsonReader
doReadDouble
in class AbstractBsonReader
protected void doReadEndArray()
AbstractBsonReader
doReadEndArray
in class AbstractBsonReader
protected void doReadEndDocument()
AbstractBsonReader
doReadEndDocument
in class AbstractBsonReader
protected int doReadInt32()
AbstractBsonReader
doReadInt32
in class AbstractBsonReader
protected long doReadInt64()
AbstractBsonReader
doReadInt64
in class AbstractBsonReader
public Decimal128 doReadDecimal128()
AbstractBsonReader
doReadDecimal128
in class AbstractBsonReader
protected String doReadJavaScript()
AbstractBsonReader
doReadJavaScript
in class AbstractBsonReader
protected String doReadJavaScriptWithScope()
AbstractBsonReader
doReadJavaScriptWithScope
in class AbstractBsonReader
protected void doReadMaxKey()
AbstractBsonReader
doReadMaxKey
in class AbstractBsonReader
protected void doReadMinKey()
AbstractBsonReader
doReadMinKey
in class AbstractBsonReader
protected void doReadNull()
AbstractBsonReader
doReadNull
in class AbstractBsonReader
protected ObjectId doReadObjectId()
AbstractBsonReader
doReadObjectId
in class AbstractBsonReader
protected BsonRegularExpression doReadRegularExpression()
AbstractBsonReader
doReadRegularExpression
in class AbstractBsonReader
protected BsonDbPointer doReadDBPointer()
AbstractBsonReader
doReadDBPointer
in class AbstractBsonReader
protected void doReadStartArray()
AbstractBsonReader
doReadStartArray
in class AbstractBsonReader
protected void doReadStartDocument()
AbstractBsonReader
doReadStartDocument
in class AbstractBsonReader
protected String doReadString()
AbstractBsonReader
doReadString
in class AbstractBsonReader
protected String doReadSymbol()
AbstractBsonReader
doReadSymbol
in class AbstractBsonReader
protected BsonTimestamp doReadTimestamp()
AbstractBsonReader
doReadTimestamp
in class AbstractBsonReader
protected void doReadUndefined()
AbstractBsonReader
doReadUndefined
in class AbstractBsonReader
protected void doSkipName()
AbstractBsonReader
doSkipName
in class AbstractBsonReader
protected void doSkipValue()
AbstractBsonReader
doSkipValue
in class AbstractBsonReader
public BsonType readBsonType()
BsonReader
readBsonType
in interface BsonReader
readBsonType
in class AbstractBsonReader
@Deprecated public void mark()
BsonReader
public BsonReaderMark getMark()
BsonReader
public void reset()
BsonReader
protected BsonDocumentReader.Context getContext()
AbstractBsonReader
getContext
in class AbstractBsonReader