Package com.mongodb

Class DefaultDBEncoder

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

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

    Fields
    Modifier and Type
    Field
    Description
    static final DBEncoderFactory
    The DBEncoderFactory for DefaultDBEncoder instances.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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)
     
     
    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, getDefaultUuidRepresentation, 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, setDefaultUuidRepresentation

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • FACTORY

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

    • DefaultDBEncoder

      public DefaultDBEncoder()
  • Method Details

    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object