Class JacksonUtils


  • public final class JacksonUtils
    extends java.lang.Object
    The utilities for Jackson ObjectMapper instances.
    Since:
    2.3
    Author:
    Artem Bilan
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.fasterxml.jackson.databind.ObjectMapper enhancedObjectMapper()
      Factory for ObjectMapper instances with registered well-known modules and disabled MapperFeature.DEFAULT_VIEW_INCLUSION and DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES features.
      static com.fasterxml.jackson.databind.ObjectMapper enhancedObjectMapper​(java.lang.ClassLoader classLoader)
      Factory for ObjectMapper instances with registered well-known modules and disabled MapperFeature.DEFAULT_VIEW_INCLUSION and DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES features.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • enhancedObjectMapper

        public static com.fasterxml.jackson.databind.ObjectMapper enhancedObjectMapper()
        Factory for ObjectMapper instances with registered well-known modules and disabled MapperFeature.DEFAULT_VIEW_INCLUSION and DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES features. The ClassUtils.getDefaultClassLoader() is used for loading module classes.
        Returns:
        the ObjectMapper instance.
      • enhancedObjectMapper

        public static com.fasterxml.jackson.databind.ObjectMapper enhancedObjectMapper​(java.lang.ClassLoader classLoader)
        Factory for ObjectMapper instances with registered well-known modules and disabled MapperFeature.DEFAULT_VIEW_INCLUSION and DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES features.
        Parameters:
        classLoader - the ClassLoader for modules to register.
        Returns:
        the ObjectMapper instance.