Package com.mongodb

Class DefaultDBEncoder

  • All Implemented Interfaces:
    DBEncoder, org.bson.BSONEncoder

    public class DefaultDBEncoder
    extends org.bson.BasicBSONEncoder
    implements DBEncoder
    The default BSON encoder for BSONObject instances.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void putDBRef​(String name, com.mongodb.DBRef ref)
      Deals with encoding database references.
      protected boolean putSpecial​(String name, Object value)  
      String toString()  
      int writeObject​(org.bson.io.OutputBuffer outputBuffer, org.bson.BSONObject document)
      Encode the BSONObject.
      • Methods inherited from class org.bson.BasicBSONEncoder

        _putObjectField, done, encode, getBsonWriter, getOutputBuffer, putArray, putBinary, putBinary, putBoolean, putCode, putCodeWScope, putDate, putDecimal128, putIterable, putMap, putMaxKey, putMinKey, putName, putNull, putNumber, putObject, putObject, putObjectId, putPattern, putString, putSymbol, putTimestamp, putUndefined, putUUID, set
    • Constructor Detail

      • DefaultDBEncoder

        public DefaultDBEncoder()
    • Method Detail

      • writeObject

        public int writeObject​(org.bson.io.OutputBuffer outputBuffer,
                               org.bson.BSONObject document)
        Description copied from interface: DBEncoder
        Encode the BSONObject.
        Specified by:
        writeObject in interface DBEncoder
        Parameters:
        outputBuffer - the OutputBuffer to write to
        document - the BSONObject to write
        Returns:
        the number of characters in the encoding
      • putSpecial

        protected boolean putSpecial​(String name,
                                     Object value)
        Overrides:
        putSpecial in class org.bson.BasicBSONEncoder
      • putDBRef

        protected void putDBRef​(String name,
                                com.mongodb.DBRef ref)
        Deals with encoding database references.
        Parameters:
        name - the name of the field in the document
        ref - the database reference object