Package org.bson.codecs
Class EncoderContext
- java.lang.Object
- 
- org.bson.codecs.EncoderContext
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classEncoderContext.BuilderA builder forEncoderContextinstances.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EncoderContext.Builderbuilder()Create a builder.<T> voidencodeWithChildContext(Encoder<T> encoder, BsonWriter writer, T value)Creates a child context based on this and serializes the value with it to the writer.EncoderContextgetChildContext()Gets a child context based on this.booleanisEncodingCollectibleDocument()Returns true if the the value to be encoded is a document that will be put in a MongoDB collection.
 
- 
- 
- 
Method Detail- 
builderpublic static EncoderContext.Builder builder() Create a builder.- Returns:
- the builder
 
 - 
isEncodingCollectibleDocumentpublic boolean isEncodingCollectibleDocument() Returns true if the the value to be encoded is a document that will be put in a MongoDB collection. Encoders for such documents might choose to act differently when encoding such as documents, e.g. by re-ordering the fields in some way (like encoding the _id field first).- Returns:
- true if the value to be encoded is a document that will be put in a MongoDB collection
 
 - 
encodeWithChildContextpublic <T> void encodeWithChildContext(Encoder<T> encoder, BsonWriter writer, T value) Creates a child context based on this and serializes the value with it to the writer.- Type Parameters:
- T- the type of the value
- Parameters:
- encoder- the encoder to encode value with
- writer- the writer to encode to
- value- the value to encode
 
 - 
getChildContextpublic EncoderContext getChildContext() Gets a child context based on this.- Returns:
- the child context
 
 
- 
 
-