@Override public void visit(ComparisonNode comparisonNode) { comparisonNode.getLHS().accept(this); comparisonNode.getRHS().accept(this); }
public void visit(ComparisonNode node) { node.getLHS().accept(this); node.getRHS().accept(this); }
public void visit(ComparisonNode node) { if (state != null) { throw new IllegalArgumentException("Comparison cannot be done within now expression"); } if (!hasNow(node)) { return; } state = new BuildState(); node.getLHS().accept(this); node.getRHS().accept(this); if (!">".equals(node.getOperator())) { throw new IllegalArgumentException("Comparison operator '" + node.getOperator() + "' is not supported"); } if (!(node.getLHS() instanceof AttributeNode)) { throw new IllegalArgumentException("Left hand side of comparison must be a document field"); } state.comparison = node; if (state.attribute != null && state.comparison != null && (state.arithmetic != null || state.now != null)) { NowQueryExpression expression = new NowQueryExpression(state.attribute, state.comparison, state.arithmetic); expressionMap.put(expression.getDocumentType(), expression); state = null; } }