Package org.apache.jackrabbit.oak.json
Class JsonUtils
- java.lang.Object
-
- org.apache.jackrabbit.oak.json.JsonUtils
-
public class JsonUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description JsonUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,Object>convertNodeStateToMap(NodeState nodeState, int maxDepth, boolean shouldSerializeHiddenNodesOrProperties)Convert a NodeState to a Map representationstatic booleanisValidJson(String text, boolean isJsonArray)static StringnodeStateToJson(NodeState nodeState, int maxDepth)Converts a NodeState to JSON string with specified depth
-
-
-
Method Detail
-
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 convertmaxDepth- 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 convertmaxDepth- 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)
-
-