public class DefaultDBCallback extends BasicBSONCallback implements DBCallback
Modifier and Type | Field and Description |
---|---|
static DBCallbackFactory |
FACTORY |
Constructor and Description |
---|
DefaultDBCallback(DBCollection collection)
Creates a new DefaultDBCallback.
|
Modifier and Type | Method and Description |
---|---|
BSONObject |
create()
Factory method for creating a new BSONObject.
|
BSONObject |
create(boolean array,
java.util.List<java.lang.String> path)
Helper method to create either a BSON Object or a BSON List depending upon whether the
array parameter is true or not. |
void |
gotDBRef(java.lang.String name,
java.lang.String namespace,
ObjectId id)
Invoked when
BSONDecoder encountered a BsonType.DB_POINTER type field in a byte sequence. |
java.lang.Object |
objectDone()
Called at the end of the document/array, and returns this object.
|
arrayDone, arrayStart, arrayStart, createBSONCallback, get, gotBinary, gotBinaryArray, gotBoolean, gotCode, gotCodeWScope, gotDate, gotDecimal128, gotDouble, gotInt, gotLong, gotMaxKey, gotMinKey, gotNull, gotObjectId, gotRegex, gotString, gotSymbol, gotTimestamp, gotUndefined, gotUUID, objectStart, objectStart, reset
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
arrayDone, arrayStart, arrayStart, createBSONCallback, get, gotBinary, gotBinaryArray, gotBoolean, gotCode, gotCodeWScope, gotDate, gotDecimal128, gotDouble, gotInt, gotLong, gotMaxKey, gotMinKey, gotNull, gotObjectId, gotRegex, gotString, gotSymbol, gotTimestamp, gotUndefined, gotUUID, objectStart, objectStart, reset
public static final DBCallbackFactory FACTORY
public DefaultDBCallback(DBCollection collection)
DBCollectionObjectFactory
to create documents, otherwise
it uses the collection's object factory.collection
- an optionally null Collection that the documents created by this callback belong to.public BSONObject create()
BasicBSONCallback
create
in class BasicBSONCallback
public BSONObject create(boolean array, java.util.List<java.lang.String> path)
BasicBSONCallback
array
parameter is true or not.create
in class BasicBSONCallback
array
- set to true to create a new BSON List, otherwise will create a new BSONObjectpath
- a list of field names to navigate to this field in the documentpublic void gotDBRef(java.lang.String name, java.lang.String namespace, ObjectId id)
BSONCallback
BSONDecoder
encountered a BsonType.DB_POINTER
type field in a byte sequence.gotDBRef
in interface BSONCallback
gotDBRef
in class BasicBSONCallback
name
- the name of the fieldnamespace
- the namespace to which reference is pointing toid
- the if of the object to which reference is pointing topublic java.lang.Object objectDone()
BSONCallback
objectDone
in interface BSONCallback
objectDone
in class BasicBSONCallback
Copyright © 2010 - 2020 Adobe. All Rights Reserved