public class DefaultDBCallback extends BasicBSONCallback implements DBCallback
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
DefaultDBCallback.DefaultFactory |
| Modifier and Type | Field and Description |
|---|---|
(package private) DBCollection |
_collection |
(package private) DB |
_db |
private java.util.LinkedList<java.lang.String> |
_nameStack |
static DBCallbackFactory |
FACTORY |
(package private) static java.util.logging.Logger |
LOGGER |
| Constructor and Description |
|---|
DefaultDBCallback(DBCollection coll)
Creates a new DefaultDBCallback.
|
| Modifier and Type | Method and Description |
|---|---|
private DBObject |
_create(java.util.List<java.lang.String> path) |
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. |
(package private) DBObject |
dbget() |
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. |
java.lang.Object |
objectDone()
Called at the end of the document/array, and returns this object.
|
void |
objectStart(boolean array,
java.lang.String name)
Deprecated.
instead, use
BasicBSONCallback.arrayStart(String) if array is true, and BasicBSONCallback.objectStart(String) if array
is false |
void |
reset()
Resets the callback, clearing all state.
|
_put, arrayDone, arrayStart, arrayStart, createBSONCallback, createList, cur, curName, get, gotBinary, gotBinaryArray, gotBoolean, gotCode, gotCodeWScope, gotDate, gotDouble, gotInt, gotLong, gotMaxKey, gotMinKey, gotNull, gotObjectId, gotRegex, gotString, gotSymbol, gotTimestamp, gotUndefined, gotUUID, isStackEmpty, objectStart, objectStart, objectStart, setRootclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitarrayDone, arrayStart, arrayStart, createBSONCallback, get, gotBinary, gotBinaryArray, gotBoolean, gotCode, gotCodeWScope, gotDate, gotDouble, gotInt, gotLong, gotMaxKey, gotMinKey, gotNull, gotObjectId, gotRegex, gotString, gotSymbol, gotTimestamp, gotUndefined, gotUUID, objectStart, objectStart, objectStartpublic static DBCallbackFactory FACTORY
private java.util.LinkedList<java.lang.String> _nameStack
final DBCollection _collection
final DB _db
static final java.util.logging.Logger LOGGER
public DefaultDBCallback(DBCollection coll)
coll - an optionally null Collection that the documents created by this callback belong to.public void gotDBRef(java.lang.String name,
java.lang.String ns,
ObjectId id)
BSONCallbackBSONDecoder encountered a DBPointer(0x0c) type field in a byte sequence.gotDBRef in interface BSONCallbackgotDBRef in class BasicBSONCallbackname - 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
public void objectStart(boolean array,
java.lang.String name)
BasicBSONCallback.arrayStart(String) if array is true, and BasicBSONCallback.objectStart(String) if array
is falseobjectStart in class BasicBSONCallbackpublic java.lang.Object objectDone()
BSONCallbackobjectDone in interface BSONCallbackobjectDone in class BasicBSONCallbackpublic BSONObject create()
BasicBSONCallbackcreate in class BasicBSONCallbackpublic BSONObject create(boolean array, java.util.List<java.lang.String> path)
BasicBSONCallbackarray parameter is true or not.create in class BasicBSONCallbackarray - 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 documentprivate DBObject _create(java.util.List<java.lang.String> path)
DBObject dbget()
public void reset()
BSONCallbackreset in interface BSONCallbackreset in class BasicBSONCallback