Package de.otto.synapse.translator
Class ObjectMappers
java.lang.Object
de.otto.synapse.translator.ObjectMappers
@ThreadSafe
public final class ObjectMappers
extends java.lang.Object
Manages the ObjectMapper used by Synapse applications for serialization and deserialization purposes.
-
Method Summary
Modifier and Type Method Description static com.fasterxml.jackson.databind.ObjectMappercurrentObjectMapper()Returns theObjectMappercurrently used by Synapse.static com.fasterxml.jackson.databind.ObjectMapperdefaultObjectMapper()static voidoverrideObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)Overrides the object mapper actually used by Synapse.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
defaultObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper defaultObjectMapper()- Returns:
- the default objectmapper configured as expected by Synapse.
-
currentObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper currentObjectMapper()Returns theObjectMappercurrently used by Synapse.By default, this is the same as
defaultObjectMapper(). You can override this mapper usingoverrideObjectMapper(ObjectMapper).- Returns:
- the
ObjectMappercurrently used by Synapse.
-
overrideObjectMapper
public static void overrideObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)Overrides the object mapper actually used by Synapse.Handle with care as there is a chance to break message passing across Synapse services if configured in an unexpected way.
- Parameters:
objectMapper- the ObjectMapper used to serialize and deserialize messages
-