org.springframework.data.repository.init
Class JacksonResourceReader
java.lang.Object
org.springframework.data.repository.init.JacksonResourceReader
- All Implemented Interfaces:
- ResourceReader
public class JacksonResourceReader
- extends Object
- implements ResourceReader
A ResourceReader using Jackson to read JSON into objects.
- Author:
- Oliver Gierke
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JacksonResourceReader
public JacksonResourceReader()
- Creates a new
JacksonResourceReader.
JacksonResourceReader
public JacksonResourceReader(org.codehaus.jackson.map.ObjectMapper mapper)
- Creates a new
JacksonResourceReader 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
.
- Parameters:
typeKey -
readFrom
public Object readFrom(Resource resource,
ClassLoader classLoader)
throws Exception
- Specified by:
readFrom in interface ResourceReader
- Throws:
Exception
Copyright © 2012. All Rights Reserved.