Class JsonUtils

java.lang.Object
org.apache.jackrabbit.oak.json.JsonUtils

public class JsonUtils extends Object
  • Constructor Details

    • JsonUtils

      public JsonUtils()
  • Method Details

    • convertNodeStateToMap

      public static Map<String,Object> convertNodeStateToMap(NodeState nodeState, int maxDepth, boolean shouldSerializeHiddenNodesOrProperties)
      Convert a NodeState to a Map representation
      Parameters:
      nodeState - The NodeState to convert
      maxDepth - Maximum depth to traverse
      Returns:
      Map representation of the NodeState
    • nodeStateToJson

      public static String nodeStateToJson(NodeState nodeState, int maxDepth) throws com.fasterxml.jackson.core.JsonProcessingException
      Converts a NodeState to JSON string with specified depth
      Parameters:
      nodeState - The NodeState to convert
      maxDepth - Maximum depth to traverse, use -1 for unlimited depth
      Returns:
      JSON string representation
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if JSON processing fails
    • isValidJson

      public static boolean isValidJson(String text, boolean isJsonArray)