public Object eval(JSONPath path, Object rootObject, Object currentObject) { return path.evalKeySet(currentObject); }
public Object eval(JSONPath path, Object rootObject, Object currentObject) { return path.evalKeySet(currentObject); }
/** * Compile jsonPath and use it to extract keySet or field names from rootObject. * * @param rootObject Can be a map or custom object. Array and Collection are not supported. * @param path JSONPath string to be compiled. * @return Set of keys, or <code>null</code> if not supported. */ public static Set<?> keySet(Object rootObject, String path) { JSONPath jsonpath = compile(path); Object result = jsonpath.eval(rootObject); return jsonpath.evalKeySet(result); }
/** * Extract keySet or field names from rootObject on this JSONPath. * * @param rootObject Can be a map or custom object. Array and Collection are not supported. * @return Set of keys, or <code>null</code> if not supported. */ public Set<?> keySet(Object rootObject) { if (rootObject == null) { return null; } init(); Object currentObject = rootObject; for (int i = 0; i < segments.length; ++i) { currentObject = segments[i].eval(this, rootObject, currentObject); } return evalKeySet(currentObject); }
/** * Compile jsonPath and use it to extract keySet or field names from rootObject. * * @param rootObject Can be a map or custom object. Array and Collection are not supported. * @param path JSONPath string to be compiled. * @return Set of keys, or <code>null</code> if not supported. */ public static Set<?> keySet(Object rootObject, String path) { JSONPath jsonpath = compile(path); Object result = jsonpath.eval(rootObject); return jsonpath.evalKeySet(result); }
/** * Extract keySet or field names from rootObject on this JSONPath. * * @param rootObject Can be a map or custom object. Array and Collection are not supported. * @return Set of keys, or <code>null</code> if not supported. */ public Set<?> keySet(Object rootObject) { if (rootObject == null) { return null; } init(); Object currentObject = rootObject; for (int i = 0; i < segments.length; ++i) { currentObject = segments[i].eval(this, rootObject, currentObject); } return evalKeySet(currentObject); }