public class DefaultDBEncoder extends BasicBSONEncoder implements DBEncoder
Modifier and Type | Field and Description |
---|---|
static DBEncoderFactory |
FACTORY |
_buf
Constructor and Description |
---|
DefaultDBEncoder() |
Modifier and Type | Method and Description |
---|---|
protected void |
putDBPointer(java.lang.String name,
java.lang.String ns,
ObjectId oid)
Deprecated.
Please see
DBPointer .
You can override putDBRef(String, DBRefBase) if you need
a specific behaviour while decoding database references. |
protected void |
putDBRef(java.lang.String name,
DBRefBase ref)
Deals with encoding database references.
|
protected boolean |
putSpecial(java.lang.String name,
java.lang.Object val)
Special values are not encoded into documents.
|
java.lang.String |
toString() |
int |
writeObject(OutputBuffer buf,
BSONObject o)
Encode the BSONObject.
|
_put, _put, _putObjectField, _putValueString, done, encode, getOutputBuffer, handleSpecialObjects, putBinary, putBinary, putBoolean, putCode, putCodeWScope, putDate, putNull, putNumber, putObject, putObject, putObjectId, putString, putSymbol, putTimestamp, putUndefined, putUUID, set, writeCString, writeInt, writeLong
public static DBEncoderFactory FACTORY
public int writeObject(OutputBuffer buf, BSONObject o)
DBEncoder
writeObject
in interface DBEncoder
buf
- the OutputBuffer to write too
- the BSONObject to writeprotected boolean putSpecial(java.lang.String name, java.lang.Object val)
BasicBSONEncoder
putSpecial
in class BasicBSONEncoder
name
- the field nameval
- the value@Deprecated protected void putDBPointer(java.lang.String name, java.lang.String ns, ObjectId oid)
DBPointer
.
You can override putDBRef(String, DBRefBase)
if you need
a specific behaviour while decoding database references.protected void putDBRef(java.lang.String name, DBRefBase ref)
name
- the name of the field in the documentref
- the database reference objectpublic java.lang.String toString()
toString
in class java.lang.Object