Class MergingEncoder<T>

  • Type Parameters:
    T - the entity type
    All Implemented Interfaces:
    org.bson.codecs.Encoder<Object>

    public class MergingEncoder<T>
    extends Object
    Since:
    2.2
    Developer note.
    This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
    • Field Detail

      • OBJECT_ID_GENERATOR

        public static final org.bson.codecs.ObjectIdGenerator OBJECT_ID_GENERATOR
    • Constructor Detail

      • MergingEncoder

        public MergingEncoder​(Query<T> query,
                              MorphiaCodec<T> morphiaCodec)
        Parameters:
        query - the query
        morphiaCodec - the codec
        Since:
        2.2
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
    • Method Detail

      • encodeDiscriminator

        protected void encodeDiscriminator​(org.bson.BsonWriter writer,
                                           EntityModel model)
      • encodeIdProperty

        protected void encodeIdProperty​(org.bson.BsonWriter writer,
                                        Object instance,
                                        org.bson.codecs.EncoderContext encoderContext,
                                        @Nullable
                                        PropertyModel idModel)
      • encodeValue

        protected void encodeValue​(org.bson.BsonWriter writer,
                                   org.bson.codecs.EncoderContext encoderContext,
                                   PropertyModel model,
                                   @Nullable
                                   Object value)
      • encode

        public void encode​(org.bson.BsonWriter writer,
                           Object value,
                           org.bson.codecs.EncoderContext encoderContext)
        Specified by:
        encode in interface org.bson.codecs.Encoder<Object>
      • getEncoderClass

        public Class<Object> getEncoderClass()
        Specified by:
        getEncoderClass in interface org.bson.codecs.Encoder<Object>
      • getMorphiaCodec

        protected MorphiaCodec getMorphiaCodec()
      • writeValue

        protected void writeValue​(org.bson.BsonWriter writer,
                                  org.bson.codecs.EncoderContext encoderContext,
                                  PropertyModel model,
                                  @Nullable
                                  Object value)