Package com.mongodb

Class DefaultDBEncoder

java.lang.Object
org.bson.BasicBSONEncoder
com.mongodb.DefaultDBEncoder
All Implemented Interfaces:
DBEncoder, BSONEncoder

public class DefaultDBEncoder extends BasicBSONEncoder implements DBEncoder
The default BSON encoder for BSONObject instances.
  • Field Details

    • FACTORY

      public static final DBEncoderFactory FACTORY
      The DBEncoderFactory for DefaultDBEncoder instances.
  • Constructor Details

    • DefaultDBEncoder

      public DefaultDBEncoder()
  • Method Details

    • writeObject

      public int writeObject(OutputBuffer outputBuffer, 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 BasicBSONEncoder
    • putDBRef

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

      public String toString()
      Overrides:
      toString in class Object