Class JsonUtility


  • public class JsonUtility
    extends Object
    Utility methods for Json handling.
    • Constructor Detail

      • JsonUtility

        public JsonUtility()
    • Method Detail

      • findElementInJson

        public static com.fasterxml.jackson.databind.JsonNode findElementInJson​(com.fasterxml.jackson.databind.JsonNode currentJson,
                                                                                String completeExpression,
                                                                                String[] traversalPath)
        Finds a given path (element in the json). Recursion.
        Parameters:
        currentJson - current json element
        traversalPath - current traversal path
        Returns:
        Object found for the traversalPath
      • flattenJsonFields

        public static LinkedHashMap<String,​com.fasterxml.jackson.databind.JsonNode> flattenJsonFields​(com.fasterxml.jackson.databind.JsonNode json)
        Converts a Json into a HashMap with the results
        Parameters:
        json - json node to be flattened
        Returns:
        LinkedHashMap<String, JsonNode> elements found