public class Jackson2ResourceReader extends Object implements ResourceReader
ResourceReader
using Jackson to read JSON into objects.ResourceReader.Type
Constructor and Description |
---|
Jackson2ResourceReader()
Creates a new
Jackson2ResourceReader . |
Jackson2ResourceReader(com.fasterxml.jackson.databind.ObjectMapper mapper)
Creates a new
Jackson2ResourceReader using the given ObjectMapper . |
Modifier and Type | Method and Description |
---|---|
Object |
readFrom(Resource resource,
ClassLoader classLoader) |
void |
setTypeKey(String typeKey)
Configures the JSON document's key to lookup the type to instantiate the object.
|
public Jackson2ResourceReader()
Jackson2ResourceReader
.public Jackson2ResourceReader(com.fasterxml.jackson.databind.ObjectMapper mapper)
Jackson2ResourceReader
using the given ObjectMapper
.mapper
- public void setTypeKey(String typeKey)
DEFAULT_TYPE_KEY
.typeKey
- public Object readFrom(Resource resource, ClassLoader classLoader) throws Exception
readFrom
in interface ResourceReader
Exception
Copyright © 2011-2016–2016 Pivotal Software, Inc.. All rights reserved.