@Override public BinaryOperator getOperator() { return operatorInfo.getOperator(); }
@Override public String getUriLiteral() { return operatorInfo.getSyntax(); }
ActualBinaryOperator nextOperator; while ((operator != null) && (operator.getOP().getPriority() >= priority)) { while ((nextOperator != null) && (nextOperator.getOP().getPriority() > operator.getOP().getPriority())) { rightNode = readElements(rightNode, nextOperator.getOP().getPriority()); nextOperator = readBinaryOperator(); if (operator.getOP().getOperator() == BinaryOperator.PROPERTY_ACCESS) { binaryNode = new MemberExpressionImpl(leftNode, rightNode); } else {
if ("Equality".equals(binOpt.getCategory()) && (leftType != null && leftType.getKind() == EdmTypeKind.ENTITY && rightType == EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.Null) final ParameterSet parameterSet = binOpt.validateParameterSet(actualParameterTypes); if (parameterSet == null) { BinaryExpressionImpl binaryExpressionImpl = (BinaryExpressionImpl) binaryExpression;
lAvailableBinaryOperators.put("/", new InfoBinaryOperator(BinaryOperator.PROPERTY_ACCESS, "Primary", 100, new ParameterSetCombination.PSCReturnTypeEqLastParameter()));// todo fix this lAvailableBinaryOperators.put(BinaryOperator.MUL.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.MUL, "Multiplicative", 60, combination)); lAvailableBinaryOperators.put(BinaryOperator.DIV.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.DIV, "Multiplicative", 60, combination)); lAvailableBinaryOperators.put(BinaryOperator.MODULO.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.MODULO, "Multiplicative", 60, combination)); lAvailableBinaryOperators.put(BinaryOperator.ADD.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.ADD, "Additive", 50, combination)); lAvailableBinaryOperators.put(BinaryOperator.SUB.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.SUB, "Additive", 50, combination)); lAvailableBinaryOperators.put(BinaryOperator.LT.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.LT, "Relational", 40, combination)); lAvailableBinaryOperators.put(BinaryOperator.GT.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.GT, "Relational", 40, combination)); lAvailableBinaryOperators.put(BinaryOperator.GE.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.GE, "Relational", 40, combination)); lAvailableBinaryOperators.put(BinaryOperator.LE.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.LE, "Relational", 40, combination)); lAvailableBinaryOperators.put(BinaryOperator.EQ.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.EQ, "Equality", 30, combination)); lAvailableBinaryOperators.put(BinaryOperator.NE.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.NE, "Equality", 30, combination));
protected void validateBinaryOperatorTypes(final BinaryExpression binaryExpression) throws ExpressionParserException, ExpressionParserInternalError { InfoBinaryOperator binOpt = availableBinaryOperators.get(binaryExpression.getOperator().toUriLiteral()); List<EdmType> actualParameterTypes = new ArrayList<EdmType>(); EdmType operand = binaryExpression.getLeftOperand().getEdmType(); if ((operand == null) && (resourceEntityType == null)) { return; } actualParameterTypes.add(operand); operand = binaryExpression.getRightOperand().getEdmType(); if ((operand == null) && (resourceEntityType == null)) { return; } actualParameterTypes.add(operand); ParameterSet parameterSet = binOpt.validateParameterSet(actualParameterTypes); if (parameterSet == null) { BinaryExpressionImpl binaryExpressionImpl = (BinaryExpressionImpl) binaryExpression; // Tested with TestParserExceptions.TestPMvalidateBinaryOperator throw FilterParserExceptionImpl.createINVALID_TYPES_FOR_BINARY_OPERATOR(binaryExpression.getOperator(), binaryExpression.getLeftOperand().getEdmType(), binaryExpression.getRightOperand().getEdmType(), binaryExpressionImpl.getToken(), curExpression); } binaryExpression.setEdmType(parameterSet.getReturnType()); }
ActualBinaryOperator nextOperator; while ((operator != null) && (operator.getOP().getPriority() >= priority)) { while ((nextOperator != null) && (nextOperator.getOP().getPriority() > operator.getOP().getPriority())) { rightNode = readElements(rightNode, nextOperator.getOP().getPriority()); nextOperator = readBinaryOperator(); if (operator.getOP().getOperator() == BinaryOperator.PROPERTY_ACCESS) { binaryNode = new MemberExpressionImpl(leftNode, rightNode); } else {
if ("Equality".equals(binOpt.getCategory()) && (leftType != null && leftType.getKind() == EdmTypeKind.ENTITY && rightType == EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.Null) final ParameterSet parameterSet = binOpt.validateParameterSet(actualParameterTypes); if (parameterSet == null) { BinaryExpressionImpl binaryExpressionImpl = (BinaryExpressionImpl) binaryExpression;
lAvailableBinaryOperators.put("/", new InfoBinaryOperator(BinaryOperator.PROPERTY_ACCESS, "Primary", 100, new ParameterSetCombination.PSCReturnTypeEqLastParameter()));// todo fix this lAvailableBinaryOperators.put(BinaryOperator.MUL.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.MUL, "Multiplicative", 60, combination)); lAvailableBinaryOperators.put(BinaryOperator.DIV.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.DIV, "Multiplicative", 60, combination)); lAvailableBinaryOperators.put(BinaryOperator.MODULO.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.MODULO, "Multiplicative", 60, combination)); lAvailableBinaryOperators.put(BinaryOperator.ADD.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.ADD, "Additive", 50, combination)); lAvailableBinaryOperators.put(BinaryOperator.SUB.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.SUB, "Additive", 50, combination)); lAvailableBinaryOperators.put(BinaryOperator.LT.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.LT, "Relational", 40, combination)); lAvailableBinaryOperators.put(BinaryOperator.GT.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.GT, "Relational", 40, combination)); lAvailableBinaryOperators.put(BinaryOperator.GE.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.GE, "Relational", 40, combination)); lAvailableBinaryOperators.put(BinaryOperator.LE.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.LE, "Relational", 40, combination)); lAvailableBinaryOperators.put(BinaryOperator.EQ.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.EQ, "Equality", 30, combination)); lAvailableBinaryOperators.put(BinaryOperator.NE.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.NE, "Equality", 30, combination));
ActualBinaryOperator nextOperator; while ((operator != null) && (operator.getOP().getPriority() >= priority)) { while ((nextOperator != null) && (nextOperator.getOP().getPriority() > operator.getOP().getPriority())) { rightNode = readElements(rightNode, nextOperator.getOP().getPriority()); nextOperator = readBinaryOperator(); if (operator.getOP().getOperator() == BinaryOperator.PROPERTY_ACCESS) { binaryNode = new MemberExpressionImpl(leftNode, rightNode); } else {
@Override public BinaryOperator getOperator() { return operatorInfo.getOperator(); }
@Override public String getUriLiteral() { return operatorInfo.getSyntax(); }
lAvailableBinaryOperators.put("/", new InfoBinaryOperator(BinaryOperator.PROPERTY_ACCESS, "Primary", 100, new ParameterSetCombination.PSCReturnTypeEqLastParameter()));// todo fix this lAvailableBinaryOperators.put(BinaryOperator.MUL.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.MUL, "Multiplicative", 60, combination)); lAvailableBinaryOperators.put(BinaryOperator.DIV.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.DIV, "Multiplicative", 60, combination)); lAvailableBinaryOperators.put(BinaryOperator.MODULO.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.MODULO, "Multiplicative", 60, combination)); lAvailableBinaryOperators.put(BinaryOperator.ADD.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.ADD, "Additive", 50, combination)); lAvailableBinaryOperators.put(BinaryOperator.SUB.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.SUB, "Additive", 50, combination)); lAvailableBinaryOperators.put(BinaryOperator.LT.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.LT, "Relational", 40, combination)); lAvailableBinaryOperators.put(BinaryOperator.GT.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.GT, "Relational", 40, combination)); lAvailableBinaryOperators.put(BinaryOperator.GE.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.GE, "Relational", 40, combination)); lAvailableBinaryOperators.put(BinaryOperator.LE.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.LE, "Relational", 40, combination)); lAvailableBinaryOperators.put(BinaryOperator.EQ.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.EQ, "Equality", 30, combination)); lAvailableBinaryOperators.put(BinaryOperator.NE.toUriLiteral(), new InfoBinaryOperator(BinaryOperator.NE, "Equality", 30, combination));
@Override public BinaryOperator getOperator() { return operatorInfo.getOperator(); }
@Override public String getUriLiteral() { return operatorInfo.getSyntax(); }
@Override public Object accept(final ExpressionVisitor visitor) throws ExceptionVisitExpression, ODataApplicationException { Object retLeftSide = leftSide.accept(visitor); Object retRightSide = rightSide.accept(visitor); return visitor.visitBinary(this, operatorInfo.getOperator(), retLeftSide, retRightSide); }
@Override public Object accept(final ExpressionVisitor visitor) throws ExceptionVisitExpression, ODataApplicationException { Object retLeftSide = leftSide.accept(visitor); Object retRightSide = rightSide.accept(visitor); return visitor.visitBinary(this, operatorInfo.getOperator(), retLeftSide, retRightSide); }
@Override public Object accept(final ExpressionVisitor visitor) throws ExceptionVisitExpression, ODataApplicationException { Object retLeftSide = leftSide.accept(visitor); Object retRightSide = rightSide.accept(visitor); return visitor.visitBinary(this, operatorInfo.getOperator(), retLeftSide, retRightSide); }
if ((actBinOp != null) && (actBinOp.operator.getOperator() != BinaryOperator.PROPERTY_ACCESS)) { validateEdmPropertyOfStructuredType(resourceEntityType, property, propertyToken); return;
if ((actBinOp != null) && (actBinOp.operator.getOperator() != BinaryOperator.PROPERTY_ACCESS)) { validateEdmPropertyOfStructuredType(resourceEntityType, property, propertyToken); return;