mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
review comments
This commit is contained in:
@@ -84,9 +84,11 @@ public class PojoUtility
|
|||||||
public static String toJsonElectronicRecord(Object model) throws JsonProcessingException
|
public static String toJsonElectronicRecord(Object model) throws JsonProcessingException
|
||||||
{
|
{
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
|
||||||
//inject the "mix-in" annotations from FilePlanComponentMix to
|
//inject the "mix-in" annotations from FilePlanComponentMix to
|
||||||
// FilePlanComponent POJO class when converting to json
|
// FilePlanComponent POJO class when converting to json
|
||||||
mapper.addMixIn(FilePlanComponent.class, FilePlanComponentMix.class);
|
mapper.addMixIn(FilePlanComponent.class, FilePlanComponentMix.class);
|
||||||
|
|
||||||
//include only values that differ from default settings to be included
|
//include only values that differ from default settings to be included
|
||||||
mapper.setSerializationInclusion(Include.NON_DEFAULT);
|
mapper.setSerializationInclusion(Include.NON_DEFAULT);
|
||||||
try
|
try
|
||||||
@@ -95,13 +97,16 @@ public class PojoUtility
|
|||||||
//return the json object
|
//return the json object
|
||||||
return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(model);
|
return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(model);
|
||||||
|
|
||||||
} catch (JsonGenerationException e)
|
}
|
||||||
|
catch (JsonGenerationException e)
|
||||||
{
|
{
|
||||||
return e.toString();
|
return e.toString();
|
||||||
} catch (JsonMappingException e)
|
}
|
||||||
|
catch (JsonMappingException e)
|
||||||
{
|
{
|
||||||
return e.toString();
|
return e.toString();
|
||||||
} catch (IOException e)
|
}
|
||||||
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
return e.toString();
|
return e.toString();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user