public class DomainObjectReader extends Object
ObjectNode to an existing domain object. This is effectively a best-effort workaround
for Jacksons inability to apply a (partial) JSON document to an existing object in a deeply nestes way. We manually
detect nested objects, lookup the original value and apply the merge recursively.| Constructor and Description |
|---|
DomainObjectReader(PersistentEntities entities,
ResourceMappings mappings)
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
merge(com.fasterxml.jackson.databind.node.ObjectNode root,
T existingObject,
com.fasterxml.jackson.databind.ObjectMapper mapper)
Merges the given
ObjectNode onto the given object. |
<T> T |
read(InputStream source,
T target,
com.fasterxml.jackson.databind.ObjectMapper mapper)
Reads the given input stream into an
ObjectNode and applies that to the given existing instance. |
public DomainObjectReader(PersistentEntities entities, ResourceMappings mappings)
entities - must not be null.mappings - must not be null.public <T> T read(InputStream source, T target, com.fasterxml.jackson.databind.ObjectMapper mapper)
ObjectNode and applies that to the given existing instance.request - must not be null.target - must not be null.mapper - must not be null.public <T> T merge(com.fasterxml.jackson.databind.node.ObjectNode root,
T existingObject,
com.fasterxml.jackson.databind.ObjectMapper mapper)
throws Exception
ObjectNode onto the given object.root - must not be null.existingObject - mapper - ExceptionCopyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.