Class EmbeddedObjectSerializer<T>

  • All Implemented Interfaces:
    com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable
    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.

    Since:
    3.0.4
    Author:
    Kevin D. Keck