public class PathLocator extends Object
JSONObject
and returns those found.
Traverses the specified JSONObject
searching 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.
Modifier and Type | Field and Description |
---|---|
protected PathDelimiter |
pathDelimiter |
protected List<String> |
pathsToFind |
Constructor and Description |
---|
PathLocator(net.minidev.json.JSONArray pathsToFind) |
PathLocator(List<String> pathsToFind) |
PathLocator(String... pathsToFind) |
Modifier and Type | Method and Description |
---|---|
List<String> |
locate(net.minidev.json.JSONObject object) |
PathLocator |
with(PathDelimiter pathDelimiter) |
protected PathDelimiter pathDelimiter
public PathLocator(net.minidev.json.JSONArray pathsToFind)
public PathLocator(String... pathsToFind)
public PathLocator with(PathDelimiter pathDelimiter)
Copyright © 2020 Chemouni Uriel. All rights reserved.