Package com.gravity9.jsonpatch
Class PathParser
- java.lang.Object
-
- com.gravity9.jsonpatch.PathParser
-
public class PathParser extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PathDetailsgetParentPathAndNewNodeName(java.lang.String path)This method parses JsonPath to find node name that needs to be added and path to the parent of new node.
-
-
-
Method Detail
-
getParentPathAndNewNodeName
public static PathDetails getParentPathAndNewNodeName(java.lang.String path) throws JsonPatchException
This method parses JsonPath to find node name that needs to be added and path to the parent of new node. Additionally, it finds if path contains filter or multi index notation (like [1:5])- Parameters:
path- Path in JsonPath or JsonPointer notation- Returns:
- PathDetails containing path to parent, name of new node and boolean value if path contains filter or multi index notation
- Throws:
JsonPatchException- when invalid path provided
-
-