Package com.mongodb

Class DefaultDBEncoder

    • Constructor Detail

      • DefaultDBEncoder

        public DefaultDBEncoder()
    • Method Detail

      • 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)
        Description copied from class: BasicBSONEncoder
        Special values are not encoded into documents.
        Overrides:
        putSpecial in class BasicBSONEncoder
        Parameters:
        name - the field name
        value - the value
        Returns:
        true if the operation is successful. This implementation always returns false.
      • 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