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 Summary
Fields Modifier and Type Field Description static DBEncoderFactory
FACTORY
-
Constructor Summary
Constructors Constructor Description DefaultDBEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
putDBRef(String name, DBRef ref)
Deals with encoding database references.protected boolean
putSpecial(String name, Object value)
String
toString()
int
writeObject(OutputBuffer outputBuffer, 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
-
-
-
-
Field Detail
-
FACTORY
public static final DBEncoderFactory FACTORY
-
-
Method Detail
-
writeObject
public int writeObject(OutputBuffer outputBuffer, BSONObject document)
Description copied from interface:DBEncoder
Encode the BSONObject.- Specified by:
writeObject
in interfaceDBEncoder
- Parameters:
outputBuffer
- the OutputBuffer to write todocument
- the BSONObject to write- Returns:
- the number of characters in the encoding
-
putSpecial
protected boolean putSpecial(String name, Object value)
- Overrides:
putSpecial
in classBasicBSONEncoder
-
putDBRef
protected void putDBRef(String name, DBRef ref)
Deals with encoding database references.- Parameters:
name
- the name of the field in the documentref
- the database reference object
-
-