public class LazyBSONCallback extends EmptyBSONCallback
BSONCallback for creation of LazyBSONObject and LazyBSONList instances.| Constructor and Description |
|---|
LazyBSONCallback() |
| Modifier and Type | Method and 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, objectStartpublic void reset()
BSONCallbackreset in interface BSONCallbackreset in class EmptyBSONCallbackpublic Object get()
BSONCallbackget in interface BSONCallbackget in class EmptyBSONCallbackpublic void gotBinary(String name, byte type, byte[] data)
BSONCallbackBsonType.BINARY value. Note that binary values have a subtype, which may
determine how the value is processed.gotBinary in interface BSONCallbackgotBinary in class EmptyBSONCallbackname - the name of the fieldtype - one of the binary subtypes: BsonBinarySubTypedata - 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