List of usage examples for org.springframework.data.rest.webmvc.config JsonPatchHandler applyPut
<T> T applyPut(ObjectNode source, T existingObject)
From source file:org.springframework.data.rest.webmvc.config.PersistentEntityResourceHandlerMethodArgumentResolver.java
private Object readPutForUpdate(IncomingRequest request, ObjectMapper mapper, Object existingObject) { try {//from ww w .j a va2 s . c o m JsonPatchHandler handler = new JsonPatchHandler(mapper, reader); JsonNode jsonNode = mapper.readTree(request.getBody()); return handler.applyPut((ObjectNode) jsonNode, existingObject); } catch (Exception o_O) { throw new HttpMessageNotReadableException(String.format(ERROR_MESSAGE, existingObject.getClass()), o_O); } }