Class SerializationSupportConverter
- java.lang.Object
-
- com.oracle.coherence.io.json.genson.Wrapper<Converter<Object>>
-
- com.oracle.coherence.io.json.internal.SerializationSupportConverter
-
- All Implemented Interfaces:
Converter<Object>,Deserializer<Object>,Serializer<Object>,AnnotatedElement
public class SerializationSupportConverter extends Wrapper<Converter<Object>> implements Converter<Object>
A converter that performs pre- and post-processing of objects during serialization, in order to handle lambdas and objects that implementSerializationSupportand/orSerializerAwareinterface.- Since:
- 20.06
- Author:
- Aleks Seovic 2018.05.30
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSerializationSupportConverter.FactoryA factory to createSerializationSupportConverterinstances.
-
Field Summary
Fields Modifier and Type Field Description protected Serializerf_serializerTheSerializer.
-
Constructor Summary
Constructors Modifier Constructor Description protectedSerializationSupportConverter(Converter<Object> nextConverter, Serializer serializer)Constructs a newSerializationSupportConverter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectdeserialize(ObjectReader reader, Context ctx)voidserialize(Object object, ObjectWriter writer, Context ctx)-
Methods inherited from class com.oracle.coherence.io.json.genson.Wrapper
decorate, getAnnotation, getAnnotations, getDeclaredAnnotations, isAnnotationPresent, isOfType, isWrapped, toAnnotatedElement, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.reflect.AnnotatedElement
getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotationsByType
-
-
-
-
Field Detail
-
f_serializer
protected final Serializer f_serializer
TheSerializer.
-
-
Constructor Detail
-
SerializationSupportConverter
protected SerializationSupportConverter(Converter<Object> nextConverter, Serializer serializer)
Constructs a newSerializationSupportConverter.- Parameters:
nextConverter- theConverterto wrapserializer- theSerializerto use
-
-
Method Detail
-
serialize
public void serialize(Object object, ObjectWriter writer, Context ctx) throws Exception
- Specified by:
serializein interfaceConverter<Object>- Specified by:
serializein interfaceSerializer<Object>- Parameters:
object- we want to serialize. The object is of type T or a subclass (if this serializer has been registered for subclasses).writer- to use to write data to the output stream.ctx- the current context.- Throws:
JsonBindingExceptionJsonStreamExceptionException
-
deserialize
public Object deserialize(ObjectReader reader, Context ctx) throws Exception
- Specified by:
deserializein interfaceConverter<Object>- Specified by:
deserializein interfaceDeserializer<Object>- Parameters:
reader- used to read data from.ctx- the current context.- Returns:
- an instance of T or a subclass of T.
- Throws:
JsonBindingExceptionJsonStreamExceptionException
-
-