BSONCallback
LazyDBCallback
public class LazyBSONCallback extends EmptyBSONCallback
BSONCallback
for creation of LazyBSONObject
and LazyBSONList
instances.Constructor | Description |
---|---|
LazyBSONCallback() |
Modifier and Type | Method | Description |
---|---|---|
List |
createArray(byte[] bytes,
int offset) |
Create a
LazyBSONList from the given bytes starting from the given offset. |
Object |
createDBRef(String ns,
ObjectId id) |
This is a factory method pattern to create appropriate objects for BSON type DBPointer(0x0c).
|
Object |
createObject(byte[] bytes,
int offset) |
Create a
LazyBSONObject instance from the given bytes starting from the given offset. |
Object |
get() |
Returns the finished top-level Document.
|
void |
gotBinary(String name,
byte type,
byte[] data) |
Called when reading a field with a
BsonType.BINARY value. |
void |
reset() |
Resets the callback, clearing all state.
|
arrayDone, arrayStart, arrayStart, createBSONCallback, gotBinaryArray, gotBoolean, gotCode, gotCodeWScope, gotDate, gotDBRef, gotDecimal128, gotDouble, gotInt, gotLong, gotMaxKey, gotMinKey, gotNull, gotObjectId, gotRegex, gotString, gotSymbol, gotTimestamp, gotUndefined, gotUUID, objectDone, objectStart, objectStart
public void reset()
BSONCallback
reset
in interface BSONCallback
reset
in class EmptyBSONCallback
public Object get()
BSONCallback
get
in interface BSONCallback
get
in class EmptyBSONCallback
public void gotBinary(String name, byte type, byte[] data)
BSONCallback
BsonType.BINARY
value. Note that binary values have a subtype, which may
determine how the value is processed.gotBinary
in interface BSONCallback
gotBinary
in class EmptyBSONCallback
name
- the name of the fieldtype
- one of the binary subtypes: BsonBinarySubType
data
- the field's valuepublic Object createObject(byte[] bytes, int offset)
LazyBSONObject
instance from the given bytes starting from the given offset.bytes
- the raw BSON bytesoffset
- the offset into the bytespublic List createArray(byte[] bytes, int offset)
LazyBSONList
from the given bytes starting from the given offset.bytes
- the raw BSON bytesoffset
- the offset into the bytes