Package org.mongojack.internal.stream
Class JacksonCodec<T>
- java.lang.Object
-
- org.mongojack.internal.stream.JacksonCodec<T>
-
- All Implemented Interfaces:
org.bson.codecs.Codec<T>
,org.bson.codecs.CollectibleCodec<T>
,org.bson.codecs.Decoder<T>
,org.bson.codecs.Encoder<T>
,org.bson.codecs.OverridableUuidRepresentationCodec<T>
public class JacksonCodec<T> extends Object implements org.bson.codecs.Codec<T>, org.bson.codecs.CollectibleCodec<T>, org.bson.codecs.OverridableUuidRepresentationCodec<T>
-
-
Constructor Summary
Constructors Constructor Description JacksonCodec(JacksonEncoder<T> encoder, JacksonDecoder<T> decoder, com.fasterxml.jackson.databind.ObjectMapper objectMapper, JacksonCodecRegistry jacksonCodecRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bson.BsonValue
constructIdValue(Object value, Optional<com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition> element)
T
decode(org.bson.BsonReader reader, org.bson.codecs.DecoderContext decoderContext)
boolean
documentHasId(T t)
void
encode(org.bson.BsonWriter writer, T value, org.bson.codecs.EncoderContext encoderContext)
T
generateIdIfAbsentFromDocument(T t)
org.bson.BsonValue
getDocumentId(T t)
Class<T>
getEncoderClass()
Optional<com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition>
getIdElementDeserializationDescription(Class<?> documentClass)
Optional<com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition>
getIdElementSerializationDescription(Class<?> documentClass)
org.bson.codecs.Codec<T>
withUuidRepresentation(org.bson.UuidRepresentation uuidRepresentation)
-
-
-
Constructor Detail
-
JacksonCodec
public JacksonCodec(JacksonEncoder<T> encoder, JacksonDecoder<T> decoder, com.fasterxml.jackson.databind.ObjectMapper objectMapper, JacksonCodecRegistry jacksonCodecRegistry)
-
-
Method Detail
-
encode
public void encode(org.bson.BsonWriter writer, T value, org.bson.codecs.EncoderContext encoderContext)
- Specified by:
encode
in interfaceorg.bson.codecs.Encoder<T>
-
getEncoderClass
public Class<T> getEncoderClass()
- Specified by:
getEncoderClass
in interfaceorg.bson.codecs.Encoder<T>
-
decode
public T decode(org.bson.BsonReader reader, org.bson.codecs.DecoderContext decoderContext)
- Specified by:
decode
in interfaceorg.bson.codecs.Decoder<T>
-
generateIdIfAbsentFromDocument
public T generateIdIfAbsentFromDocument(T t)
- Specified by:
generateIdIfAbsentFromDocument
in interfaceorg.bson.codecs.CollectibleCodec<T>
-
documentHasId
public boolean documentHasId(T t)
- Specified by:
documentHasId
in interfaceorg.bson.codecs.CollectibleCodec<T>
-
getDocumentId
public org.bson.BsonValue getDocumentId(T t)
- Specified by:
getDocumentId
in interfaceorg.bson.codecs.CollectibleCodec<T>
-
withUuidRepresentation
public org.bson.codecs.Codec<T> withUuidRepresentation(org.bson.UuidRepresentation uuidRepresentation)
- Specified by:
withUuidRepresentation
in interfaceorg.bson.codecs.OverridableUuidRepresentationCodec<T>
-
constructIdValue
public org.bson.BsonValue constructIdValue(Object value, Optional<com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition> element)
-
getIdElementDeserializationDescription
public Optional<com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition> getIdElementDeserializationDescription(Class<?> documentClass)
-
-