@Override public void evaluate(String currentPath, PathRef parent, Object model, EvaluationContextImpl ctx) { PathToken pt = next(); walk(pt, currentPath, parent, model, ctx, createScanPredicate(pt, ctx)); }
public static void walkObject(PathToken pt, String currentPath, PathRef parent, Object model, EvaluationContextImpl ctx, Predicate predicate) { if (predicate.matches(model)) { pt.evaluate(currentPath, parent, model, ctx); } Collection<String> properties = ctx.jsonProvider().getPropertyKeys(model); for (String property : properties) { String evalPath = currentPath + "['" + property + "']"; Object propertyModel = ctx.jsonProvider().getMapValue(model, property); if (propertyModel != JsonProvider.UNDEFINED) { walk(pt, evalPath, PathRef.create(model, property), propertyModel, ctx, predicate); } } }
public static void walkArray(PathToken pt, String currentPath, PathRef parent, Object model, EvaluationContextImpl ctx, Predicate predicate) { if (predicate.matches(model)) { if (pt.isLeaf()) { pt.evaluate(currentPath, parent, model, ctx); } else { PathToken next = pt.next(); Iterable<?> models = ctx.jsonProvider().toIterable(model); int idx = 0; for (Object evalModel : models) { String evalPath = currentPath + "[" + idx + "]"; next.evaluate(evalPath, parent, evalModel, ctx); idx++; } } } Iterable<?> models = ctx.jsonProvider().toIterable(model); int idx = 0; for (Object evalModel : models) { String evalPath = currentPath + "[" + idx + "]"; walk(pt, evalPath, PathRef.create(model, idx), evalModel, ctx, predicate); idx++; } }
@Override public void evaluate(String currentPath, PathRef parent, Object model, EvaluationContextImpl ctx) { PathToken pt = next(); walk(pt, currentPath, parent, model, ctx, createScanPredicate(pt, ctx)); }
public static void walkObject(PathToken pt, String currentPath, PathRef parent, Object model, EvaluationContextImpl ctx, Predicate predicate) { if (predicate.matches(model)) { pt.evaluate(currentPath, parent, model, ctx); } Collection<String> properties = ctx.jsonProvider().getPropertyKeys(model); for (String property : properties) { String evalPath = currentPath + "['" + property + "']"; Object propertyModel = ctx.jsonProvider().getMapValue(model, property); if (propertyModel != JsonProvider.UNDEFINED) { walk(pt, evalPath, PathRef.create(model, property), propertyModel, ctx, predicate); } } }
public static void walkArray(PathToken pt, String currentPath, PathRef parent, Object model, EvaluationContextImpl ctx, Predicate predicate) { if (predicate.matches(model)) { if (pt.isLeaf()) { pt.evaluate(currentPath, parent, model, ctx); } else { PathToken next = pt.next(); Iterable<?> models = ctx.jsonProvider().toIterable(model); int idx = 0; for (Object evalModel : models) { String evalPath = currentPath + "[" + idx + "]"; next.evaluate(evalPath, parent, evalModel, ctx); idx++; } } } Iterable<?> models = ctx.jsonProvider().toIterable(model); int idx = 0; for (Object evalModel : models) { String evalPath = currentPath + "[" + idx + "]"; walk(pt, evalPath, PathRef.create(model, idx), evalModel, ctx, predicate); idx++; } }
@Override public void evaluate(String currentPath, PathRef parent, Object model, EvaluationContextImpl ctx) { PathToken pt = next(); walk(pt, currentPath, parent, model, ctx, createScanPredicate(pt, ctx)); }
public static void walkObject(PathToken pt, String currentPath, PathRef parent, Object model, EvaluationContextImpl ctx, Predicate predicate) { if (predicate.matches(model)) { pt.evaluate(currentPath, parent, model, ctx); } Collection<String> properties = ctx.jsonProvider().getPropertyKeys(model); for (String property : properties) { String evalPath = currentPath + "['" + property + "']"; Object propertyModel = ctx.jsonProvider().getMapValue(model, property); if (propertyModel != JsonProvider.UNDEFINED) { walk(pt, evalPath, PathRef.create(model, property), propertyModel, ctx, predicate); } } }
public static void walkArray(PathToken pt, String currentPath, PathRef parent, Object model, EvaluationContextImpl ctx, Predicate predicate) { if (predicate.matches(model)) { if (pt.isLeaf()) { pt.evaluate(currentPath, parent, model, ctx); } else { PathToken next = pt.next(); Iterable<?> models = ctx.jsonProvider().toIterable(model); int idx = 0; for (Object evalModel : models) { String evalPath = currentPath + "[" + idx + "]"; next.evaluate(evalPath, parent, evalModel, ctx); idx++; } } } Iterable<?> models = ctx.jsonProvider().toIterable(model); int idx = 0; for (Object evalModel : models) { String evalPath = currentPath + "[" + idx + "]"; walk(pt, evalPath, PathRef.create(model, idx), evalModel, ctx, predicate); idx++; } }