Class EmbeddedObjectSerializer<T>

  • All Implemented Interfaces:
    Direct Known Subclasses:
    CalendarSerializer, DateSerializer, ObjectIdSerializer

    public abstract class EmbeddedObjectSerializer<T>
    extends TransformingEmbeddedObjectSerializer<T,​T>
    Safe embedded object serializer.

    When used with BsonObjectGenerator or DBEncoderBsonGenerator, passes values straight through.

    When used with a TokenBuffer (as by BeanDeserializer.deserializeWithUnwrapped(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext)), temporarily clears the TokenBuffer codec before passing the value through, so it will be properly serialized as an embedded object. (Failure to do so would blow up the stack, as the TokenBuffer would pass the object right back to the ObjectMapper.)

    When used with other JsonSerializers, throws IllegalArgumentException with a message that it's designed for use only with BsonObjectGenerator or DBEncoderBsonGenerator or TokenBuffer.

    Kevin D. Keck