Package net.minidev.json.actions
Class PathLocator
- java.lang.Object
-
- net.minidev.json.actions.PathLocator
-
public class PathLocator extends Object
Searches for paths in aJSONObjectand returns those found.Traverses the specified
JSONObjectsearching for nodes whose paths (from the root down) match any of the user-specified paths. The paths that match are returned.A path to locate must be specified in the n-gram format - a list of keys from the root down separated by dots: K0[[[[.K1].K2].K3]...]
A key to the right of a dot is a direct child of a key to the left of a dot. Keys with a dot in their name are not supported.- Author:
- adoneitan@gmail.com
-
-
Field Summary
Fields Modifier and Type Field Description protected PathDelimiterpathDelimiterprotected List<String>pathsToFind
-
Constructor Summary
Constructors Constructor Description PathLocator(String... pathsToFind)PathLocator(List<String> pathsToFind)PathLocator(net.minidev.json.JSONArray pathsToFind)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>locate(net.minidev.json.JSONObject object)PathLocatorwith(PathDelimiter pathDelimiter)
-
-
-
Field Detail
-
pathDelimiter
protected PathDelimiter pathDelimiter
-
-
Method Detail
-
with
public PathLocator with(PathDelimiter pathDelimiter)
-
-