Package com.mongodb
Class DefaultDBEncoder
java.lang.Object
org.bson.BasicBSONEncoder
com.mongodb.DefaultDBEncoder
- All Implemented Interfaces:
DBEncoder
,BSONEncoder
The default BSON encoder for BSONObject instances.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final DBEncoderFactory
TheDBEncoderFactory
forDefaultDBEncoder
instances. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Deals with encoding database references.protected boolean
putSpecial
(String name, Object value) toString()
int
writeObject
(OutputBuffer outputBuffer, 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
-
Field Details
-
FACTORY
TheDBEncoderFactory
forDefaultDBEncoder
instances.
-
-
Constructor Details
-
DefaultDBEncoder
public DefaultDBEncoder()
-
-
Method Details
-
writeObject
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
- Overrides:
putSpecial
in classBasicBSONEncoder
-
putDBRef
Deals with encoding database references.- Parameters:
name
- the name of the field in the documentref
- the database reference object
-
toString
-