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 binary value.
|
void |
reset()
Resets the callback, clearing all state.
|
void |
setRootObject(Object root)
Deprecated.
This method is NOT a part of public API and will be dropped in 3.x versions.
|
arrayDone, arrayStart, arrayStart, createBSONCallback, gotBinaryArray, gotBoolean, gotCode, gotCodeWScope, gotDate, gotDBRef, gotDouble, gotInt, gotLong, gotMaxKey, gotMinKey, gotNull, gotObjectId, gotRegex, gotString, gotSymbol, gotTimestamp, gotUndefined, gotUUID, objectDone, objectStart, 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
gotBinary
in interface BSONCallback
gotBinary
in class EmptyBSONCallback
name
- the name of the fieldtype
- one of the binary subtypesdata
- the field's value@Deprecated public void setRootObject(Object root)
public 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