public final class JacksonSerializationProvider extends java.lang.Object implements SerializationProvider
SerializationProvider
implementation using jackson.Constructor and Description |
---|
JacksonSerializationProvider()
New instances which will use the default
ObjectMapper . |
JacksonSerializationProvider(com.fasterxml.jackson.databind.ObjectMapper mapper)
New instance.
|
Modifier and Type | Method and Description |
---|---|
<T> StreamingDeserializer<T> |
getDeserializer(java.lang.Class<T> classToDeSerialize)
Provide a
StreamingDeserializer instance that can deserialize instances of T . |
<T> StreamingDeserializer<T> |
getDeserializer(TypeHolder<T> typeToDeserialize)
Provide a
StreamingDeserializer instance that can deserialize instances of T . |
<T> StreamingSerializer |
getSerializer(java.lang.Class<T> classToSerialize)
Provide a
StreamingSerializer instance that can serialize instances of T . |
<T> StreamingSerializer |
getSerializer(TypeHolder<T> typeToSerialize)
Provide a
StreamingSerializer instance that can serialize instances of T . |
<T> void |
serialize(T toSerialize,
Buffer destination)
Serializes the passed object
toSerialize to the passed Buffer . |
public JacksonSerializationProvider()
ObjectMapper
.public JacksonSerializationProvider(com.fasterxml.jackson.databind.ObjectMapper mapper)
mapper
- ObjectMapper
to use.public <T> StreamingSerializer getSerializer(java.lang.Class<T> classToSerialize)
SerializationProvider
StreamingSerializer
instance that can serialize instances of T
.getSerializer
in interface SerializationProvider
T
- The data type to serialize.classToSerialize
- The class for T
, the object to be serialized.StreamingSerializer
that can serialize instances of T
.public <T> StreamingSerializer getSerializer(TypeHolder<T> typeToSerialize)
SerializationProvider
StreamingSerializer
instance that can serialize instances of T
.getSerializer
in interface SerializationProvider
T
- The data type to serialize.typeToSerialize
- TypeHolder
holding the ParameterizedType
to be serialized.StreamingSerializer
that can serialize instances of T
.public <T> StreamingDeserializer<T> getDeserializer(java.lang.Class<T> classToDeSerialize)
SerializationProvider
StreamingDeserializer
instance that can deserialize instances of T
.getDeserializer
in interface SerializationProvider
T
- The data type to deserialize.classToDeSerialize
- The class for T
, the object to be deserialized.StreamingDeserializer
that can deserialize instances of T
.public <T> StreamingDeserializer<T> getDeserializer(TypeHolder<T> typeToDeserialize)
SerializationProvider
StreamingDeserializer
instance that can deserialize instances of T
.getDeserializer
in interface SerializationProvider
T
- The data type to deserialize.typeToDeserialize
- TypeHolder
holding the ParameterizedType
to be deserialized.StreamingDeserializer
that can deserialize instances of T
.public <T> void serialize(T toSerialize, Buffer destination)
SerializationProvider
toSerialize
to the passed Buffer
.serialize
in interface SerializationProvider
T
- The data type to serialize.toSerialize
- Object to serialize.destination
- The Buffer
to which the serialized representation of toSerialize
is written.