Class 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.ObjectMapper currentObjectMapper()
      Returns the ObjectMapper currently used by Synapse.
      static com.fasterxml.jackson.databind.ObjectMapper defaultObjectMapper()  
      static void overrideObjectMapper​(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 Detail

      • 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 the ObjectMapper currently used by Synapse.

        By default, this is the same as defaultObjectMapper(). You can override this mapper using overrideObjectMapper(ObjectMapper).

        Returns:
        the ObjectMapper currently 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