From ed55ed717655229172cea01dda1b339985b5e49f Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Mon, 30 Jan 2017 13:29:05 +0200 Subject: [PATCH] review comments --- .../alfresco/rest/rm/community/util/PojoUtility.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/util/PojoUtility.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/util/PojoUtility.java index 2d0eb321e7..5b98b437ae 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/util/PojoUtility.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/util/PojoUtility.java @@ -84,9 +84,11 @@ public class PojoUtility public static String toJsonElectronicRecord(Object model) throws JsonProcessingException { ObjectMapper mapper = new ObjectMapper(); + //inject the "mix-in" annotations from FilePlanComponentMix to // FilePlanComponent POJO class when converting to json mapper.addMixIn(FilePlanComponent.class, FilePlanComponentMix.class); + //include only values that differ from default settings to be included mapper.setSerializationInclusion(Include.NON_DEFAULT); try @@ -95,13 +97,16 @@ public class PojoUtility //return the json object return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(model); - } catch (JsonGenerationException e) + } + catch (JsonGenerationException e) { return e.toString(); - } catch (JsonMappingException e) + } + catch (JsonMappingException e) { return e.toString(); - } catch (IOException e) + } + catch (IOException e) { return e.toString(); }