@Override public QueryExpression iterate(QueryExpression q, Path context) { // Don't send classes the base iterator doesn't recognize if (q instanceof TruePH || q instanceof FalsePH) { return q; } else { return super.iterate(q, context); } }
@Override public QueryExpression iterate(QueryExpression q, Path context) { // Don't send classes the base iterator doesn't recognize if (q instanceof TruePH || q instanceof FalsePH) { return q; } else { return super.iterate(q, context); } }
@Override public QueryExpression iterate(QueryExpression q, Path context) { if (nested == 0) { fieldInfo = new ArrayList<>(); } nested++; try { return super.iterate(q, context); } finally { nested--; } }
@Override public QueryExpression iterate(QueryExpression q, Path context) { if (nested == 0) { fieldInfo = new ArrayList<>(); } nested++; try { return super.iterate(q, context); } finally { nested--; } }
/** * Default behavior is to recursively iterate the nested query. If nested * processing returns an object different from the original nested query, * this method creates a new unary logical expression using the new query * expression, and returns that. */ protected QueryExpression itrUnaryLogicalExpression(UnaryLogicalExpression q, Path context) { QueryExpression newq = iterate(q.getQuery(), context); if (newq != q.getQuery()) { return new UnaryLogicalExpression(q.getOp(), newq); } else { return q; } }
/** * Default behavior is to recursively iterate the nested query. If nested * processing returns an object different from the original nested query, * this method creates a new unary logical expression using the new query * expression, and returns that. */ protected QueryExpression itrUnaryLogicalExpression(UnaryLogicalExpression q, Path context) { QueryExpression newq = iterate(q.getQuery(), context); if (newq != q.getQuery()) { return new UnaryLogicalExpression(q.getOp(), newq); } else { return q; } }
/** * Default behavior is to recursively iterate the nested query. If nested * processing returns an object different from the original nested query, * this method creates a new array match expression using the new query * expression, and returns that. */ protected QueryExpression itrArrayMatchExpression(ArrayMatchExpression q, Path context) { QueryExpression newq = iterate(q.getElemMatch(), new Path(new Path(context, q.getArray()), Path.ANYPATH)); if (newq != q.getElemMatch()) { return new ArrayMatchExpression(q.getArray(), newq); } else { return q; } } }
/** * Default behavior is to recursively iterate the nested query. If nested * processing returns an object different from the original nested query, * this method creates a new array match expression using the new query * expression, and returns that. */ protected QueryExpression itrArrayMatchExpression(ArrayMatchExpression q, Path context) { QueryExpression newq = iterate(q.getElemMatch(), new Path(new Path(context, q.getArray()), Path.ANYPATH)); if (newq != q.getElemMatch()) { return new ArrayMatchExpression(q.getArray(), newq); } else { return q; } } }
/** * Default behavior is to recursively iterate the nested quereies. If nested * processing returns objects different from the original nested queries, * this method creates a new n-ary logical expression using the new query * expressions and returns that. */ protected QueryExpression itrNaryLogicalExpression(NaryLogicalExpression q, Path context) { CopyOnWriteIterator<QueryExpression> itr = new CopyOnWriteIterator<>(q.getQueries()); while (itr.hasNext()) { QueryExpression nestedq = itr.next(); QueryExpression newq = iterate(nestedq, context); if (newq != nestedq) { itr.set(newq); } } if (itr.isCopied()) { return new NaryLogicalExpression(q.getOp(), itr.getCopiedList()); } else { return q; } }
/** * Default behavior is to recursively iterate the nested quereies. If nested * processing returns objects different from the original nested queries, * this method creates a new n-ary logical expression using the new query * expressions and returns that. */ protected QueryExpression itrNaryLogicalExpression(NaryLogicalExpression q, Path context) { CopyOnWriteIterator<QueryExpression> itr = new CopyOnWriteIterator<>(q.getQueries()); while (itr.hasNext()) { QueryExpression nestedq = itr.next(); QueryExpression newq = iterate(nestedq, context); if (newq != nestedq) { itr.set(newq); } } if (itr.isCopied()) { return new NaryLogicalExpression(q.getOp(), itr.getCopiedList()); } else { return q; } }