public interface BSONCallback
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
arrayDone()
Called the end of the array, and returns the completed array.
|
void |
arrayStart()
Signals the start of a BSON array.
|
void |
arrayStart(java.lang.String name)
Signals the start of a BSON array, with its field name.
|
BSONCallback |
createBSONCallback()
Factory method for BSONCallbacks.
|
java.lang.Object |
get()
Returns the finished top-level Document.
|
void |
gotBinary(java.lang.String name,
byte type,
byte[] data)
Called when reading a field with a binary value.
|
void |
gotBinaryArray(java.lang.String name,
byte[] data)
Deprecated.
|
void |
gotBoolean(java.lang.String name,
boolean value)
Called when reading a field with a Boolean value.
|
void |
gotCode(java.lang.String name,
java.lang.String code)
Called when reading a field with a JavaScript value.
|
void |
gotCodeWScope(java.lang.String name,
java.lang.String code,
java.lang.Object scope)
Called when reading a field with a JavaScript with Scope value.
|
void |
gotDate(java.lang.String name,
long millis)
Called when reading a field with a DateTime value.
|
void |
gotDBRef(java.lang.String name,
java.lang.String ns,
ObjectId id)
Invoked when
BSONDecoder encountered a DBPointer(0x0c) type field in a byte sequence. |
void |
gotDouble(java.lang.String name,
double value)
Called when reading a field with a Double value.
|
void |
gotInt(java.lang.String name,
int value)
Called when reading a field with an Int32 value.
|
void |
gotLong(java.lang.String name,
long value)
Called when reading a field with an Int64 value.
|
void |
gotMaxKey(java.lang.String name)
Called when reading a field with a MaxKey value.
|
void |
gotMinKey(java.lang.String name)
Called when reading a field with a MinKey value.
|
void |
gotNull(java.lang.String name)
Called when reading a BSON field that exists but has a null value.
|
void |
gotObjectId(java.lang.String name,
ObjectId id)
Called when reading a field with an ObjectID value.
|
void |
gotRegex(java.lang.String name,
java.lang.String pattern,
java.lang.String flags)
Called when reading a field with a Regex value.
|
void |
gotString(java.lang.String name,
java.lang.String value)
Called when reading a field with a String value.
|
void |
gotSymbol(java.lang.String name,
java.lang.String value)
Called when reading a field with a Symbol value.
|
void |
gotTimestamp(java.lang.String name,
int time,
int inc)
Called when reading a field with a Timestamp value.
|
void |
gotUndefined(java.lang.String name)
Called when reading a field with an Undefined value.
|
void |
gotUUID(java.lang.String name,
long part1,
long part2)
Called when reading a field with a
UUID value. |
java.lang.Object |
objectDone()
Called at the end of the document/array, and returns this object.
|
void |
objectStart()
Signals the start of a BSON document, which usually maps onto some Java object.
|
void |
objectStart(boolean array)
Deprecated.
|
void |
objectStart(java.lang.String name)
Signals the start of a BSON document, which usually maps onto some Java object.
|
void |
reset()
Resets the callback, clearing all state.
|
void objectStart()
void objectStart(java.lang.String name)
name
- the field name of the document.@Deprecated void objectStart(boolean array)
array
- true if this object is an arrayjava.lang.Object objectDone()
void reset()
java.lang.Object get()
BSONCallback createBSONCallback()
void arrayStart()
void arrayStart(java.lang.String name)
name
- the name of this array fieldjava.lang.Object arrayDone()
void gotNull(java.lang.String name)
name
- the name of the fieldvoid gotUndefined(java.lang.String name)
name
- the name of the fieldvoid gotMinKey(java.lang.String name)
name
- the name of the fieldvoid gotMaxKey(java.lang.String name)
name
- the name of the fieldvoid gotBoolean(java.lang.String name, boolean value)
name
- the name of the fieldvalue
- the field's valuevoid gotDouble(java.lang.String name, double value)
name
- the name of the fieldvalue
- the field's valuevoid gotInt(java.lang.String name, int value)
name
- the name of the fieldvalue
- the field's valuevoid gotLong(java.lang.String name, long value)
name
- the name of the fieldvalue
- the field's valuevoid gotDate(java.lang.String name, long millis)
name
- the name of the fieldmillis
- the date and time in millisecondsvoid gotString(java.lang.String name, java.lang.String value)
name
- the name of the fieldvalue
- the field's valuevoid gotSymbol(java.lang.String name, java.lang.String value)
name
- the name of the fieldvalue
- the field's valuevoid gotRegex(java.lang.String name, java.lang.String pattern, java.lang.String flags)
name
- the name of the fieldpattern
- the regex patternflags
- the optional flags for the regular expressionvoid gotTimestamp(java.lang.String name, int time, int inc)
name
- the name of the fieldtime
- the time in seconds since epochinc
- an incrementing ordinal for operations within a given secondvoid gotObjectId(java.lang.String name, ObjectId id)
name
- the name of the fieldid
- the object IDvoid gotDBRef(java.lang.String name, java.lang.String ns, ObjectId id)
BSONDecoder
encountered a DBPointer(0x0c) type field in a byte sequence.name
- the name of the fieldns
- the namespace to which reference is pointing toid
- the if of the object to which reference is pointing to@Deprecated void gotBinaryArray(java.lang.String name, byte[] data)
name
- the name of the fielddata
- the field's valuevoid gotBinary(java.lang.String name, byte type, byte[] data)
name
- the name of the fieldtype
- one of the binary subtypesdata
- the field's valuevoid gotUUID(java.lang.String name, long part1, long part2)
UUID
value. This is a binary value of subtype UuidLegacy.name
- the name of the fieldpart1
- the first part of the UUIDpart2
- the second part of the UUIDvoid gotCode(java.lang.String name, java.lang.String code)
name
- the name of the fieldcode
- the JavaScript codevoid gotCodeWScope(java.lang.String name, java.lang.String code, java.lang.Object scope)
name
- the name of the fieldcode
- the JavaScript codescope
- a document representing the scope for the code