@Test public void relational() throws Exception { Expression expression = parseExpression("5 gt 5"); assertEquals("{5 GT 5}", expression.toString()); expression = parseExpression("5 ge 5"); assertEquals("{5 GE 5}", expression.toString()); expression = parseExpression("5 lt 5"); assertEquals("{5 LT 5}", expression.toString()); expression = parseExpression("5 le 5"); assertEquals("{5 LE 5}", expression.toString()); assertEquals("{5 LE 5.1}", parseExpression("5 le 5.1").toString()); assertEquals("{1 GT null}", parseExpression("1 gt null").toString()); assertEquals("{null GE 2}", parseExpression("null ge 2").toString()); assertEquals("{null LE null}", parseExpression("null le null").toString()); wrongExpression("5 gt duration'PT5H'"); }
private Expression parseExpression() throws UriParserException, UriValidationException { Expression left = parseAnd(); while (tokenizer.next(TokenKind.OrOperator)) { checkType(left, EdmPrimitiveTypeKind.Boolean); checkNoCollection(left); final Expression right = parseAnd(); checkType(right, EdmPrimitiveTypeKind.Boolean); checkNoCollection(right); left = new BinaryImpl(left, BinaryOperatorKind.OR, right, odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean)); } return left; }
ExpressionParser { private Expression parseExpression() throws UriParserException, UriValidationException { Expression left = parseAnd(); while (tokenizer.next(TokenKind.OrOperator)) { checkType(left, EdmPrimitiveTypeKind.Boolean); checkNoCollection(left); final Expression right = parseAnd(); checkType(right, EdmPrimitiveTypeKind.Boolean); checkNoCollection(right); left = new BinaryImpl(left, BinaryOperatorKind.OR, right, odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean)); } return left; } }
ExpressionParser { private Expression parseExpression() throws UriParserException, UriValidationException { Expression left = parseAnd(); while (tokenizer.next(TokenKind.OrOperator)) { checkType(left, EdmPrimitiveTypeKind.Boolean); checkNoCollection(left); final Expression right = parseAnd(); checkType(right, EdmPrimitiveTypeKind.Boolean); checkNoCollection(right); left = new BinaryImpl(left, BinaryOperatorKind.OR, right, odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean)); } return left; } ExpressionParser(final Edm edm, final OData odata); }
ExpressionParser { private Expression parseExpression() throws UriParserException, UriValidationException { Expression left = parseAnd(); while (tokenizer.next(TokenKind.OrOperator)) { checkType(left, EdmPrimitiveTypeKind.Boolean); checkNoCollection(left); final Expression right = parseAnd(); checkType(right, EdmPrimitiveTypeKind.Boolean); checkNoCollection(right); left = new BinaryImpl(left, BinaryOperatorKind.OR, right, odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean)); } return left; } ExpressionParser(final Edm edm, final OData odata); Expression parse(UriTokenizer tokenizer, final EdmType referringType,
      final Collection<String> crossjoinEntitySetNames, final Map<String, AliasQueryOption> aliases); }
ExpressionParser { private Expression parseExpression() throws UriParserException, UriValidationException { Expression left = parseAnd(); while (tokenizer.next(TokenKind.OrOperator)) { checkType(left, EdmPrimitiveTypeKind.Boolean); checkNoCollection(left); final Expression right = parseAnd(); checkType(right, EdmPrimitiveTypeKind.Boolean); checkNoCollection(right); left = new BinaryImpl(left, BinaryOperatorKind.OR, right, odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean)); } return left; } ExpressionParser(final Edm edm, final OData odata); Expression parse(UriTokenizer tokenizer, final EdmType referringType,
      final Collection<String> crossjoinEntitySetNames, final Map<String, AliasQueryOption> aliases);  }