Package org.apache.jackrabbit.oak.json
Class JsonUtils
java.lang.Object
org.apache.jackrabbit.oak.json.JsonUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertNodeStateToMap(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
-
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 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
-