Package fr.gouv.vitam.ihmdemo.core
Class JsonTransformer
java.lang.Object
fr.gouv.vitam.ihmdemo.core.JsonTransformer
This class is used in order to make transformations on Json objects received from Vitam
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.node.ObjectNodebuildAllParentsRef(String unitId, com.fasterxml.jackson.databind.JsonNode allParents) This method builds an ObjectNode based on a list of JsonNode objectstatic com.fasterxml.jackson.databind.JsonNodetransformResultObjects(com.fasterxml.jackson.databind.JsonNode searchResult) This method transforms ResultObjects so thr IHM could display results
-
Method Details
-
transformResultObjects
public static com.fasterxml.jackson.databind.JsonNode transformResultObjects(com.fasterxml.jackson.databind.JsonNode searchResult) This method transforms ResultObjects so thr IHM could display results- Parameters:
searchResult- the Json to be transformed- Returns:
- the transformed JsonNode
-
buildAllParentsRef
public static com.fasterxml.jackson.databind.node.ObjectNode buildAllParentsRef(String unitId, com.fasterxml.jackson.databind.JsonNode allParents) throws VitamException This method builds an ObjectNode based on a list of JsonNode object- Parameters:
unitId- achive unitallParents- list of JsonNode Objects used to build the referential- Returns:
- An ObjectNode where the key is the identifier and the value is the parent details (Title, Id, _up)
- Throws:
VitamException- if error when creating parent ObjectNode
-