Class ObjectMapperWrapper

  • All Implemented Interfaces:
    java.io.Serializable

    public class ObjectMapperWrapper
    extends java.lang.Object
    implements java.io.Serializable
    Wraps a Jackson ObjectMapper so that you can supply your own ObjectMapper reference. see Jackson2ObjectMapperBuilder from Spring and the com.vladmihalcea.hibernate.type.util.ObjectMapperWrapper for design calls findAndRegisterModules to
    See Also:
    Serialized Form
    • Constructor Detail

      • ObjectMapperWrapper

        public ObjectMapperWrapper()
      • ObjectMapperWrapper

        public ObjectMapperWrapper​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    • Method Detail

      • setupDefaultObjectMapper

        public static com.fasterxml.jackson.databind.ObjectMapper setupDefaultObjectMapper()
      • getObjectMapper

        public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      • fromString

        public <T> T fromString​(java.lang.String string,
                                java.lang.Class<T> clazz)
                         throws com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException
      • fromString

        public <T> T fromString​(java.lang.String string,
                                java.lang.reflect.Type type)
                         throws com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException
      • fromBytes

        public <T> T fromBytes​(byte[] value,
                               java.lang.Class<T> clazz)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • fromBytes

        public <T> T fromBytes​(byte[] value,
                               java.lang.reflect.Type type)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString​(java.lang.Object value)
                                  throws com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException
      • toBytes

        public byte[] toBytes​(java.lang.Object value)
                       throws com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException
      • toJsonNode

        public com.fasterxml.jackson.databind.JsonNode toJsonNode​(java.lang.String value)
                                                           throws com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException