Evaluates a JsonPath expression returning a multiple elements.
@param json JSON value.
@param jsonPath expression to evaluate.
@return result results of expression.
@throws java.lang.RuntimeException if jsonPath would return a single element.
501244
public List<Object> getAllJsonPath(String json, String jsonPath) {
        List<Object> result;
        if (JsonPath.isPathDefinite(jsonPath)) {
            Object val = getJsonPath(json, jsonPath);
            if (val == null) {
                result = Collections.emptyList();
            } else {
                result = Collections.singletonList(val);
            }
        } else {
            result = parseJson(json).read(jsonPath);
        }
        return result;
    }
1059507
public static JSONValue parse(String jsonString) throws JSONException {
		if (jsonString == null || "".equals(jsonString)) {
			return JSONNull.getInstance();
		}
		if (jsonString.charAt(0) == '[') {
			return new JSONArray(eval(jsonString));
		}
		return new JSONObject(eval(jsonString));
	}
1047111
def p_jsonpath_named_operator(self, p):
        ""
        if p[1] == 'len':
            p[0] = _iterable.Len()
        elif p[1] == 'sorted':
            p[0] = _iterable.SortedThis()
        elif p[1].startswith("split("):
            p[0] = _string.Split(p[1])
        elif p[1].startswith("sub("):
            p[0] = _string.Sub(p[1])
        else:
            super(ExtentedJsonPathParser, self).p_jsonpath_named_operator(p)
204128
@Override
    public JSONObject toJSON(StaticRouting routing) {
        JSONObject o = new JSONObject();
        o.put("type", getJSONId());
        JSONArray a = new JSONArray();
        Map<StaticRouting.NodesMap, Map<Link, Boolean>> routes = routing.getStaticRoutes();
        for (Map.Entry<StaticRouting.NodesMap, Map<Link, Boolean>> e : routes.entrySet()) {
            StaticRouting.NodesMap nm = e.getKey();
            JSONObject ao = new JSONObject();
            ao.put("nodes_map", nodesMapToJSON(nm));
            JSONArray links = new JSONArray();
            Map<Link, Boolean> v = e.getValue();
            for (Link l : v.keySet()) {
                JSONObject lo = new JSONObject();
                lo.put("link", l.id());
                lo.put("direction", routes.get(nm).get(l).toString());
                links.add(lo);
            }
            ao.put("links", links);
            a.add(ao);
        }
        o.put(ROUTES_LABEL, a);
        return o;
    }
833880
static javax.json.JsonValue map(final JsonValue jsonValue) {
        if (jsonValue instanceof JsonArray)
            return map((JsonArray) jsonValue);
        return map((JsonObject) jsonValue);
    }
316451
public static function loadJSON($filepath,$prefix_path=null){
    $data = file_get_contents($filepath);
    $results = $data?json_decode($data,true):[];
    if($results) {
      $results = static::filterWith(["load.json", "load"], $results);
      static::loadArray($results,$prefix_path);
    }
  }
214710
function JSONPathNode(n) {
        // Create a RED node
        RED.nodes.createNode(this,n);

        // Store local copies of the node configuration (as defined in the .html)
        this.expression = n.expression;
        this.split = n.split;

        var node = this;

        this.on("input", function(msg) {
            if ( msg.hasOwnProperty("payload") ) {
                var input = msg.payload;
                if (typeof msg.payload === "string") {
                    // It's a string: parse it as JSON
                    try {
                        input = JSON.parse(msg.payload);
                    } catch (e) {
                        node.warn("The message received is not JSON. Ignoring it.");
                        return;
                    }
                }
                // Evalute the JSONPath expresssion
                var evalResult = jsonPath.eval(input, node.expression);

                if (!node.split) {
                    // Batch it in one message. Carry pre-existing properties
                    msg.payload = evalResult;
                    node.send(msg);
                } else {
                    // Send one message per match result
                    var response = evalResult.map(function (value) {
                        return {"payload": value};
                    });
                    node.send([response]);
                }
            }
        });


        this.on("close", function() {
            // Called when the node is shutdown - eg on redeploy.
            // Allows ports to be closed, connections dropped etc.
            // eg: this.client.disconnect();
        });
    }
147912
public <T> Collection<T> collectAll(InputStream inputStream, Class<T> tClass, JsonPath... paths) {
        CollectAllListener<T> listener = new CollectAllListener<T>(jsonProvider, tClass);
        SurfingConfiguration.Builder builder = configBuilder();
        for (JsonPath jsonPath : paths) {
            builder.bind(jsonPath, listener);
        }
        surf(inputStream, builder.build());
        return listener.getCollection();
    }
1193027
public ZooActionBuilder extract(String jsonPath, String variableName) {
        JsonPathVariableExtractor jsonPathVariableExtractor = new JsonPathVariableExtractor();
        Map<String, String> pathVariableMap = new HashMap<>();
        pathVariableMap.put(jsonPath, variableName);
        jsonPathVariableExtractor.setJsonPathExpressions(pathVariableMap);
        action.addVariableExtractors(jsonPathVariableExtractor);
        return this;
    }
450980
public Collection<Object> collectAll(InputStream inputStream, JsonPath... paths) {
        return collectAll(inputStream, Object.class, paths);
    }
918641
def _read_jsonl(filepath, kwargs):
    """"""
    with open(filepath) as data_file:
        data = [json.loads(line, **kwargs)
                for line in data_file
                if len(line) > 0]
    return data
94792
@SuppressWarnings("unchecked")
    public <T> T collectOne(InputStream inputStream, Class<T> tClass, JsonPath... paths) {
        CollectOneListener listener = new CollectOneListener(true);
        SurfingConfiguration.Builder builder = configBuilder().skipOverlappedPath();
        for (JsonPath jsonPath : paths) {
            builder.bind(jsonPath, listener);
        }
        surf(inputStream, builder.build());
        Object value = listener.getValue();
        return tClass.cast(jsonProvider.cast(value, tClass));
    }
28280
public static boolean allJSONArrays(JSONArray array) throws JSONException {
        for (int i = 0; i < array.length(); ++i) {
            if (!(array.get(i) instanceof JSONArray)) {
                return false;
            }
        }
        return true;
    }
10302
public static <T> T loadJsonToBean(String jsonPath, Class<T> clazz) throws IOException {
        return loadJsonToBean(jsonPath, ValueConsts.NULL_STRING, clazz);
    }
999017
public static SimpleFeatureCollection readJsonfile( String path ) throws Exception {

        OmsJsonFeatureReader reader = new OmsJsonFeatureReader();
        reader.file = path;
        reader.readFeatureCollection();

        return reader.geodata;
    }
177808
public AbstractObjectAssert<?, Object> jsonPath(String path) {
        return Assertions.assertThat(actual.read(path, Object.class));
    }
678743
public Object eval(String path) {
        String key = pathToKey(path);
        return jsonStore.containsKey(key) ? jsonStore.get(key) : JSONPath.eval(jsonObject, checkPath(path));
    }