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.- Author:
- Oliver Gierke, Janne Valkealahti
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.repository.init.ResourceReader
org.springframework.data.repository.init.ResourceReader.Type -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newJackson2ResourceReader.StateMachineJackson2ResourceReader(com.fasterxml.jackson.databind.ObjectMapper mapper) Creates a newJackson2ResourceReaderusing the givenObjectMapper. -
Method Summary
Modifier and TypeMethodDescriptionreadFrom(org.springframework.core.io.Resource resource, ClassLoader classLoader) voidsetTypeKey(String typeKey) Configures the JSON document's key to lookup the type to instantiate the object.
-
Constructor Details
-
StateMachineJackson2ResourceReader
public StateMachineJackson2ResourceReader()Creates a newJackson2ResourceReader. -
StateMachineJackson2ResourceReader
public StateMachineJackson2ResourceReader(com.fasterxml.jackson.databind.ObjectMapper mapper) Creates a newJackson2ResourceReaderusing the givenObjectMapper.- Parameters:
mapper- the mapper
-
-
Method Details
-
setTypeKey
Configures the JSON document's key to lookup the type to instantiate the object. Defaults toJackson2ResourceReader.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:
readFromin interfaceorg.springframework.data.repository.init.ResourceReader- Throws:
Exception
-