Spring Data Commons

org.springframework.data.repository.init
Class JacksonResourceReader

java.lang.Object
  extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.springframework.data.repository.init.ResourceReader
ResourceReader.Type
 
Constructor Summary
JacksonResourceReader()
          Creates a new JacksonResourceReader.
JacksonResourceReader(org.codehaus.jackson.map.ObjectMapper mapper)
          Creates a new JacksonResourceReader using the given ObjectMapper.
 
Method Summary
 Object readFrom(Resource resource, ClassLoader classLoader)
           
 void setTypeKey(String typeKey)
          Configures the JSON document's key to lookup the type to instantiate the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 -
Method Detail

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

Spring Data Commons

Copyright © 2012. All Rights Reserved.