if (hasExpression()) { expression.toParsedText(writer, actual); writer.append(SPACE);
if (hasExpression()) { expression.toParsedText(writer, actual); writer.append(SPACE);
if (hasExpression()) { children.add(expression); children.add(buildStringExpression(SPACE));
if (hasExpression()) { children.add(expression); children.add(buildStringExpression(SPACE));
/** * {@inheritDoc} */ @Override public void visit(InExpression expression) { int position = visitor.queryPosition.getPosition(expression) - visitor.corrections.peek(); int length = 0; if (expression.hasExpression()) { length += expression.getExpression().getLength() + SPACE_LENGTH; } // Within "IN" if (visitor.isPositionWithin(position, length, expression.getIdentifier())) { boolean hasOnlyIdentifier = !expression.hasExpression() && !expression.hasInItems(); if (hasOnlyIdentifier) { visitor.corrections.add(visitor.queryPosition.getPosition(expression)); } super.visit(expression); if (hasOnlyIdentifier) { visitor.corrections.pop(); } } else { super.visit(expression); } } }
/** * Validates the given {@link InExpression}. The test to perform is: * <ul> * <li>If the expression is a path expression, validation makes sure it is an association mapping, * a basic field is not allowed.</li> * </ul> * * @param expression The {@link InExpression} to validate */ protected void validateInExpression(InExpression expression) { // Validate the left expression if (expression.hasExpression()) { Expression stringExpression = expression.getExpression(); // Special case for state field path expression StateFieldPathExpression pathExpression = getStateFieldPathExpression(stringExpression); if (pathExpression != null) { validateStateFieldPathExpression(pathExpression, validPathExpressionTypeForInExpression()); } else { stringExpression.accept(this); } } // Validate the items expression.getInItems().accept(getInItemsVisitor()); }
/** * Validates the given {@link InExpression}. The test to perform is: * <ul> * <li>If the expression is a path expression, validation makes sure it is an association mapping, * a basic field is not allowed.</li> * </ul> * * @param expression The {@link InExpression} to validate */ protected void validateInExpression(InExpression expression) { // Validate the left expression if (expression.hasExpression()) { Expression stringExpression = expression.getExpression(); // Special case for state field path expression StateFieldPathExpression pathExpression = getStateFieldPathExpression(stringExpression); if (pathExpression != null) { validateStateFieldPathExpression(pathExpression, validPathExpressionTypeForInExpression()); } else { stringExpression.accept(this); } } // Validate the items expression.getInItems().accept(getInItemsVisitor()); }
/** * {@inheritDoc} */ public void visit(InExpression expression) { if (badExpression) { if (!expression.hasExpression() && positionWithinInvalidExpression <= 2 /* IN */) { queryPosition.setExpression(expression); queryPosition.addPosition(expression, positionWithinInvalidExpression); } } else { if (expression.hasInItems() && !expression.hasRightParenthesis()) { expression.getInItems(); } if (queryPosition.getExpression() == null) { queryPosition.setExpression(expression); } queryPosition.addPosition(expression, expression.getLength() - correction); } }
int length = 0; if (expression.hasExpression()) { length = expression.getExpression().getLength() + SPACE_LENGTH;
if (!expression.hasExpression()) { int startPosition = position(expression); addProblem(expression, startPosition, InExpression_MissingExpression); (expression.hasExpression() ? 1 : 0) + (expression.hasNot() ? 4 /* NOT + whitespace */ : 0) + 2 /* IN */; (expression.hasExpression() ? 1 : 0) + (expression.hasNot() ? 4 /* NOT + whitespace */ : 0) + 2 /* IN */ + (expression.hasExpression() ? 1 : 0) + (expression.hasNot() ? 4 /* NOT + whitespace */ : 0) + 2 /* IN */ +
if (!expression.hasExpression()) { int startPosition = position(expression); addProblem(expression, startPosition, InExpression_MissingExpression); (expression.hasExpression() ? 1 : 0) + (expression.hasNot() ? 4 /* NOT + whitespace */ : 0) + 2 /* IN */; (expression.hasExpression() ? 1 : 0) + (expression.hasNot() ? 4 /* NOT + whitespace */ : 0) + 2 /* IN */ + (expression.hasExpression() ? 1 : 0) + (expression.hasNot() ? 4 /* NOT + whitespace */ : 0) + 2 /* IN */ +