Class StateMachineJackson2ResourceReader

java.lang.Object
org.springframework.statemachine.data.support.StateMachineJackson2ResourceReader
All Implemented Interfaces:
org.springframework.data.repository.init.ResourceReader

public class StateMachineJackson2ResourceReader extends Object implements org.springframework.data.repository.init.ResourceReader
A ResourceReader using Jackson to read JSON into objects.
  • Constructor Details

    • StateMachineJackson2ResourceReader

      public StateMachineJackson2ResourceReader()
      Creates a new Jackson2ResourceReader.
    • StateMachineJackson2ResourceReader

      public StateMachineJackson2ResourceReader(com.fasterxml.jackson.databind.ObjectMapper mapper)
      Creates a new Jackson2ResourceReader using the given ObjectMapper.
      Parameters:
      mapper - the mapper
  • Method Details

    • setTypeKey

      public void setTypeKey(String typeKey)
      Configures the JSON document's key to lookup the type to instantiate the object. Defaults to Jackson2ResourceReader.DEFAULT_TYPE_KEY.
      Parameters:
      typeKey - the new type key
    • readFrom

      public Object readFrom(org.springframework.core.io.Resource resource, ClassLoader classLoader) throws Exception
      Specified by:
      readFrom in interface org.springframework.data.repository.init.ResourceReader
      Throws:
      Exception