/** * {@inheritDoc} */ @Override protected final void addChildrenTo(Collection<Expression> children) { children.add(getExpression()); }
/** * {@inheritDoc} */ @Override protected final void addChildrenTo(Collection<Expression> children) { children.add(getExpression()); }
pathExp = (AbstractPathExpression) ((AbstractSingleEncapsulatedExpression) expression).getExpression();
/** * {@inheritDoc} */ public void acceptChildren(ExpressionVisitor visitor) { getExpression().accept(visitor); }
/** * Returns the length of the encapsulated expression. * * @param expression {@link AbstractSingleEncapsulatedExpression} being validated * @return The length of the encapsulated expression */ protected int encapsulatedExpressionLength(T expression) { return validator.length(expression.getExpression()); }
/** * {@inheritDoc} */ public void acceptChildren(ExpressionVisitor visitor) { getExpression().accept(visitor); }
/** * Returns the length of the encapsulated expression. * * @param expression {@link AbstractSingleEncapsulatedExpression} being validated * @return The length of the encapsulated expression */ protected int encapsulatedExpressionLength(T expression) { return validator.length(expression.getExpression()); }
/** * Determines whether the encapsulated expression is valid. * * @param expression The {@link AbstractSingleEncapsulatedExpression} being validated * @return <code>true</code> if the encapsulated expression is valid; <code>false</code> * otherwise */ protected boolean isEncapsulatedExpressionValid(T expression) { return validator.isValid(expression.getExpression(), expression.getEncapsulatedExpressionQueryBNFId()); }
/** * Determines whether the encapsulated expression is valid. * * @param expression The {@link AbstractSingleEncapsulatedExpression} being validated * @return <code>true</code> if the encapsulated expression is valid; <code>false</code> * otherwise */ protected boolean isEncapsulatedExpressionValid(T expression) { return validator.isValid(expression.getExpression(), expression.getEncapsulatedExpressionQueryBNFId()); }
/** * Validates the given {@link AbstractSingleEncapsulatedExpression}'s encapsulated expression if * it is a state field path expression and makes sure it is mapping to a basic mapping. That * means relationship field mapping is not allowed. * * @param expression The {@link AbstractSingleEncapsulatedExpression} to validate its encapsulated * expression if it's a state field path expression, otherwise does nothing * @return <code>false</code> if the encapsulated expression was validated and is invalid; * <code>true</code> otherwise */ protected boolean validateFunctionPathExpression(AbstractSingleEncapsulatedExpression expression) { boolean valid = true; if (expression.hasEncapsulatedExpression()) { Expression encapsulatedExpression = expression.getExpression(); // Special case for state field path expression, association field is not allowed StateFieldPathExpression pathExpression = getStateFieldPathExpression(encapsulatedExpression); if (pathExpression != null) { valid = validateStateFieldPathExpression(pathExpression, PathType.BASIC_FIELD_ONLY); } else { encapsulatedExpression.accept(this); } } return valid; }
/** * Validates the given {@link AbstractSingleEncapsulatedExpression}'s encapsulated expression if * it is a state field path expression and makes sure it is mapping to a basic mapping. That * means relationship field mapping is not allowed. * * @param expression The {@link AbstractSingleEncapsulatedExpression} to validate its encapsulated * expression if it's a state field path expression, otherwise does nothing * @return <code>false</code> if the encapsulated expression was validated and is invalid; * <code>true</code> otherwise */ protected boolean validateFunctionPathExpression(AbstractSingleEncapsulatedExpression expression) { boolean valid = true; if (expression.hasEncapsulatedExpression()) { Expression encapsulatedExpression = expression.getExpression(); // Special case for state field path expression, association field is not allowed StateFieldPathExpression pathExpression = getStateFieldPathExpression(encapsulatedExpression); if (pathExpression != null) { valid = validateStateFieldPathExpression(pathExpression, PathType.BASIC_FIELD_ONLY); } else { encapsulatedExpression.accept(this); } } return valid; }
protected void visitAbstractSingleEncapsulatedExpression(AbstractSingleEncapsulatedExpression expression) { if (badExpression) { if (positionWithinInvalidExpression <= expression.getIdentifier().length()) { queryPosition.setExpression(expression); queryPosition.addPosition(expression, positionWithinInvalidExpression); } } else { if (expression.hasEncapsulatedExpression() && !expression.hasRightParenthesis()) { expression.getExpression().accept(this); } if (queryPosition.getExpression() == null) { queryPosition.setExpression(expression); } queryPosition.addPosition(expression, expression.getLength() - correction); } }