Rule functionOrFieldList() { return Sequence(push(new LinkedList()), functionOrFieldOrString(), ZeroOrMore(COMMA, functionOrFieldOrString()), push(WikittyQueryFunction.createFusionIfNeeded((List)pop()))); } Rule functionOrFieldOrString() {
/** * gere eq, startsWith, endsWith, isNull * @return */ Rule isNull() { return Sequence(field(), push(match()), space(), EQUALS, space(), icNULL, push(new Null(toElement(pop().toString())))); }
/** * gere eq, isNull * @return */ Rule isNotNull() { return Sequence(field(), push(match()), space(), NOT_EQUALS, space(), icNULL, push(new NotNull(toElement(pop().toString())))); }
Rule notlike() { return Sequence(field(), push(match()), space(), icUNLIKE, space(), value(), push(new Unlike(toElement(pop(1).toString()), (ConditionValue)pop()))); } Rule between() {
Rule containsOne() { Var<List<ConditionValue>> elems = new Var<List<ConditionValue>>(new LinkedList<ConditionValue>()); return Sequence(field(), push(match()), space(), EQUALS, space(), CURLY_BRACKET_OPEN, space(), value(), elems.get().add((ConditionValue)pop()), space(), ZeroOrMore(COMMA, space(), value(), elems.get().add((ConditionValue)pop()), space()), CURLY_BRACKET_CLOSE, push(new ContainsOne(toElement(pop().toString()), elems.get()))); } Rule select() {
Rule less() { return Sequence(field(), push(match()), space(), LESS, space(), value(), push(new Less(toElement(pop(1).toString()), (ConditionValue)pop()))); } Rule lesseq() {
Rule lesseq() { return Sequence(field(), push(match()), space(), LESS_OR_EQUALS, space(), value(), push(new LessOrEquals(toElement(pop(1).toString()), (ConditionValue)pop()))); } Rule greater() {
Rule greater() { return Sequence(field(), push(match()), space(), GREATER, space(), value(), push(new Greater(toElement(pop(1).toString()), (ConditionValue)pop()))); } Rule greatereq() {
/** * gere eq, startsWith, endsWith, isNull * @return */ Rule eqIgnoreCaseAndAccent() { return Sequence(field(), push(match()), space(), EQUALS_IGNORE_CASE_AND_ACCENT, space(), value(), push(new Equals(toElement(pop(1).toString()), (ConditionValue)pop(), true))); }
Rule greatereq() { return Sequence(field(), push(match()), space(), GREATER_OR_EQUALS, space(), value(), push(new GreaterOrEquals(toElement(pop(1).toString()), (ConditionValue)pop()))); } Rule like() {
/** * gere eq, startsWith, endsWith, isNull * @return */ Rule eq() { return Sequence(field(), push(match()), space(), EQUALS, space(), value(), push(new Equals(toElement(pop(1).toString()), (ConditionValue)pop()))); }
/** * gere eq, isNull * @return */ Rule neq() { return Sequence(field(), push(match()), space(), NOT_EQUALS, space(), value(), push(new NotEquals(toElement(pop(1).toString()), (ConditionValue)pop()))); }
Rule like() { return Sequence(field(), push(match()), space(), icLIKE, space(), value(), push(new Like(toElement(pop(1).toString()), (ConditionValue)pop()))); } Rule notlike() {
Rule fieldFunction() { Var<String> alias = new Var<String>(); return Sequence(field(), push(toElement(match())), Optional(alias(alias)), push(new FunctionFieldValue(alias.get(), pop().toString()))); }
/** * gere eq, isNull * @return */ Rule neqIgnoreCaseAndAccent() { return Sequence(field(), push(match()), space(), NOT_EQUALS_IGNORE_CASE_AND_ACCENT, space(), value(), push(new NotEquals(toElement(pop(1).toString()), (ConditionValue)pop(), true))); }
Rule stringFunction() { Var<String> alias = new Var<String>(); return Sequence(valueText(), Optional(alias(alias)), push(new FunctionValue(alias.get(), ((ConditionValueString)pop()).getValue() ))); }
Rule function() { Var<String> alias = new Var<String>(); return Sequence(OneOrMore(FirstOf(field(), AnyOf("#"))), push(match()), BRACKET_OPEN, push(new LinkedList()), Optional(functionOrFieldOrString(), ZeroOrMore(COMMA, functionOrFieldOrString())), BRACKET_CLOSE, Optional(alias(alias)), push(WikittyQueryFunction.create(pop(1).toString(), alias.get(), (List)pop()))); }
Rule between() { return Sequence(field(), push(match()), space(), EQUALS, space(), SQUARE_BRACKET_OPEN, space(), value(), space(), icTO, space(), value(), space(), SQUARE_BRACKET_CLOSE, push(new Between(toElement(pop(2).toString()), (ConditionValue)pop(1), (ConditionValue)pop()))); } Rule containsAll() {