public class DefaultSerializationMapper extends Object implements SerializationMapper
Timestamp, while preserving backwards
compatibility with old serialized versions, but it can be extended for new classes X with the same backwards considerations:
For old serialized objects: If you have an instance of a class X already serialized, this logic won't alter the deserialization. This is the important part to preserve backwards.
For new objects to be serialized: If you have an instance of X and you want to serialize it with a different logic, you can add
some logic in the method mapBeforeSerialization(Object). It should wrap the instance of X into an instance of W(X).
For the original Timestamp case, it will be wrapped in a TimestampWrapper instance.
For serialized instances of new W(X): after deserializing the instance of the wrapper, you have to add the symmetric logic to
mapAfterDeserialization(Object). It will be called after than an object was deserialized.
| Constructor and Description |
|---|
DefaultSerializationMapper() |
| Modifier and Type | Method and Description |
|---|---|
Object |
mapAfterDeserialization(Object deserialized)
Builds an object from the passed object if it's a wrapper.
|
Object |
mapBeforeSerialization(Object original)
Wraps the passed object into another object if it's needed for serialization.
|
public Object mapBeforeSerialization(Object original)
SerializationMapperSerializationMapper.mapAfterDeserialization(Object).mapBeforeSerialization in interface SerializationMapperoriginal - the object to be wrapped.public Object mapAfterDeserialization(Object deserialized)
SerializationMapperSerializationMapper.mapBeforeSerialization(Object).mapAfterDeserialization in interface SerializationMapperdeserialized - the object that was deserialized.Copyright © 2006–2025 MuleSoft, Inc.. All rights reserved.