Class JsonUtility
java.lang.Object
org.gcube.informationsystem.utils.JsonUtility
A utility class for working with JSON.
- Author:
- Luca Frosini (ISTI - CNR)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.gcube.com.fasterxml.jackson.databind.JsonNodegetJsonNode(String json) Parses a JSON string into aJsonNode.
-
Constructor Details
-
JsonUtility
public JsonUtility()
-
-
Method Details
-
getJsonNode
public static org.gcube.com.fasterxml.jackson.databind.JsonNode getJsonNode(String json) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException, IOException Parses a JSON string into aJsonNode.- Parameters:
json- The JSON string.- Returns:
- The parsed
JsonNode, ornullif the input is null or empty. - Throws:
IOException- if an I/O error occurs.org.gcube.com.fasterxml.jackson.core.JsonProcessingException- if a JSON processing error occurs.
-