Class AbstractJacksonJsonObjectMapper<N,​P,​J>

java.lang.Object
org.springframework.integration.support.json.AbstractJacksonJsonObjectMapper<N,​P,​J>
Type Parameters:
N - - The expected type of JSON Node.
P - - The expected type of JSON Parser.
J - - The expected type of Java Type representation.
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, JsonObjectMapper<N,​P>
Direct Known Subclasses:
Jackson2JsonObjectMapper

public abstract class AbstractJacksonJsonObjectMapper<N,​P,​J>
extends java.lang.Object
implements JsonObjectMapper<N,​P>, org.springframework.beans.factory.BeanClassLoaderAware
Base class for Jackson JsonObjectMapper implementations.
Since:
3.0
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected static java.util.Collection<java.lang.Class<?>> SUPPORTED_JSON_TYPES  
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractJacksonJsonObjectMapper()  
  • Method Summary

    Modifier and Type Method Description
    protected abstract J constructType​(java.lang.reflect.Type type)  
    protected J createJavaType​(java.util.Map<java.lang.String,​java.lang.Object> javaTypes, java.lang.String javaTypeKey)  
    protected abstract J extractJavaType​(java.util.Map<java.lang.String,​java.lang.Object> javaTypes)  
    protected abstract <T> T fromJson​(java.lang.Object json, J type)  
    <T> T fromJson​(java.lang.Object json, java.lang.Class<T> valueType)  
    <T> T fromJson​(java.lang.Object json, java.util.Map<java.lang.String,​java.lang.Object> javaTypes)  
    <T> T fromJson​(java.lang.Object json, org.springframework.core.ResolvableType valueType)
    Deserialize a JSON to an expected ResolvableType.
    protected java.lang.ClassLoader getClassLoader()  
    void setBeanClassLoader​(java.lang.ClassLoader classLoader)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.integration.support.json.JsonObjectMapper

    fromJson, populateJavaTypes, toJson, toJson, toJsonNode
  • Field Details

    • SUPPORTED_JSON_TYPES

      protected static final java.util.Collection<java.lang.Class<?>> SUPPORTED_JSON_TYPES
  • Constructor Details

  • Method Details

    • setBeanClassLoader

      public void setBeanClassLoader​(java.lang.ClassLoader classLoader)
      Specified by:
      setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAware
    • getClassLoader

      protected java.lang.ClassLoader getClassLoader()
    • fromJson

      public <T> T fromJson​(java.lang.Object json, java.lang.Class<T> valueType) throws java.io.IOException
      Specified by:
      fromJson in interface JsonObjectMapper<N,​P>
      Throws:
      java.io.IOException
    • fromJson

      public <T> T fromJson​(java.lang.Object json, org.springframework.core.ResolvableType valueType) throws java.io.IOException
      Description copied from interface: JsonObjectMapper
      Deserialize a JSON to an expected ResolvableType.
      Specified by:
      fromJson in interface JsonObjectMapper<N,​P>
      Type Parameters:
      T - the expected object type
      Parameters:
      json - the JSON to deserialize
      valueType - the ResolvableType for the target object.
      Returns:
      deserialization result object
      Throws:
      java.io.IOException - a JSON parsing exception
    • fromJson

      public <T> T fromJson​(java.lang.Object json, java.util.Map<java.lang.String,​java.lang.Object> javaTypes) throws java.io.IOException
      Specified by:
      fromJson in interface JsonObjectMapper<N,​P>
      Throws:
      java.io.IOException
    • createJavaType

      protected J createJavaType​(java.util.Map<java.lang.String,​java.lang.Object> javaTypes, java.lang.String javaTypeKey)
    • fromJson

      protected abstract <T> T fromJson​(java.lang.Object json, J type) throws java.io.IOException
      Throws:
      java.io.IOException
    • extractJavaType

      protected abstract J extractJavaType​(java.util.Map<java.lang.String,​java.lang.Object> javaTypes)
    • constructType

      protected abstract J constructType​(java.lang.reflect.Type type)