@Override public void exitKeyvalue(KeyvalueContext ctx) { KeyValueQueryPart kvqp = new KeyValueQueryPart( currentKeyvalue.getString("key"), currentKeyvalue.getString("value"), ComparisonOperator.valueOf(currentKeyvalue.getString("comp"))); JsonObject q = makeQuery(kvqp); if (!combine(q)) { result.push(q); } currentKeyvalue = null; }
@Override public void enterString(StringContext ctx) { String str = ctx.getText(); if (currentKeyvalue != null) { if (currentKeyvalue.containsKey("key")) { currentKeyvalue.put("value", str); } else { currentKeyvalue.put("key", str); } } else { StringQueryPart sqp = new StringQueryPart(str); JsonObject q = makeQuery(sqp); if (!combine(q)) { result.push(q); } } }