Package com.mongodb

Class DefaultDBCallback

  • All Implemented Interfaces:
    DBCallback, org.bson.BSONCallback

    public class DefaultDBCallback
    extends org.bson.BasicBSONCallback
    implements DBCallback
    An implementation of DBCallback that decodes into a DBObject.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.bson.BSONObject create()  
      org.bson.BSONObject create​(boolean array, List<String> path)  
      void gotDBRef​(String name, String namespace, org.bson.types.ObjectId id)  
      Object objectDone()  
      • Methods inherited from class org.bson.BasicBSONCallback

        _put, arrayDone, arrayStart, arrayStart, createBSONCallback, createList, cur, curName, get, gotBinary, gotBinaryArray, gotBoolean, gotCode, gotCodeWScope, gotDate, gotDecimal128, gotDouble, gotInt, gotLong, gotMaxKey, gotMinKey, gotNull, gotObjectId, gotRegex, gotString, gotSymbol, gotTimestamp, gotUndefined, gotUUID, isStackEmpty, objectStart, objectStart, reset, setRoot
      • Methods inherited from interface org.bson.BSONCallback

        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
    • Constructor Detail

      • DefaultDBCallback

        public DefaultDBCallback​(DBCollection collection)
        Creates a new DefaultDBCallback. If the Collection is null, it uses DBCollectionObjectFactory to create documents, otherwise it uses the collection's object factory.
        Parameters:
        collection - an optionally null Collection that the documents created by this callback belong to.
    • Method Detail

      • create

        public org.bson.BSONObject create()
        Overrides:
        create in class org.bson.BasicBSONCallback
      • create

        public org.bson.BSONObject create​(boolean array,
                                          List<String> path)
        Overrides:
        create in class org.bson.BasicBSONCallback
      • gotDBRef

        public void gotDBRef​(String name,
                             String namespace,
                             org.bson.types.ObjectId id)
        Specified by:
        gotDBRef in interface org.bson.BSONCallback
        Overrides:
        gotDBRef in class org.bson.BasicBSONCallback
      • objectDone

        public Object objectDone()
        Specified by:
        objectDone in interface org.bson.BSONCallback
        Overrides:
        objectDone in class org.bson.BasicBSONCallback