org.springframework.data.repository.init
Class Jackson2ResourceReader
java.lang.Object
org.springframework.data.repository.init.Jackson2ResourceReader
- All Implemented Interfaces:
- ResourceReader
public class Jackson2ResourceReader
- extends Object
- implements ResourceReader
A ResourceReader
using Jackson to read JSON into objects.
- Since:
- 1.6
- Author:
- Oliver Gierke
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Jackson2ResourceReader
public Jackson2ResourceReader()
- Creates a new
Jackson2ResourceReader
.
Jackson2ResourceReader
public Jackson2ResourceReader(com.fasterxml.jackson.databind.ObjectMapper mapper)
- Creates a new
Jackson2ResourceReader
using the given ObjectMapper
.
- Parameters:
mapper
-
setTypeKey
public void setTypeKey(String typeKey)
- Configures the JSON document's key to lookup the type to instantiate the object. Defaults to
DEFAULT_TYPE_KEY
.
- Parameters:
typeKey
-
readFrom
public Object readFrom(Resource resource,
ClassLoader classLoader)
throws Exception
- Specified by:
readFrom
in interface ResourceReader
- Throws:
Exception
Copyright © 2011-2013-2013 Pivotal. All Rights Reserved.