/** * Determines whether something was parsed after the left parenthesis and before the * <code><b>AS</b></code> identifier. * * @return <code>true</code> the expression to be cast was parsed; <code>false</code> otherwise * @since 2.5 */ public boolean hasScalarExpression() { return super.hasEncapsulatedExpression(); }
/** * Determines whether something was parsed after the left parenthesis and before the * <code><b>AS</b></code> identifier. * * @return <code>true</code> the expression to be cast was parsed; <code>false</code> otherwise * @since 2.5 */ public boolean hasScalarExpression() { return super.hasEncapsulatedExpression(); }
/** * {@inheritDoc} */ @Override public boolean hasEncapsulatedExpression() { return hasFunctionName() || hasComma || super.hasEncapsulatedExpression(); }
/** * {@inheritDoc} */ @Override public boolean hasEncapsulatedExpression() { return super.hasEncapsulatedExpression() || (asIdentifier != null) || hasDatabaseType(); }
/** * {@inheritDoc} */ public boolean hasRightParenthesis(T expression) { // If the encapsulated expression is missing, then no need to // add a problem for a missing ')' because the encapsulated // expression needs to be specified first return !expression.hasEncapsulatedExpression() || expression.hasRightParenthesis(); }
/** * {@inheritDoc} */ @Override public boolean hasEncapsulatedExpression() { return hasFunctionName() || hasComma || super.hasEncapsulatedExpression(); }
/** * {@inheritDoc} */ public boolean hasRightParenthesis(T expression) { // If the encapsulated expression is missing, then no need to // add a problem for a missing ')' because the encapsulated // expression needs to be specified first return !expression.hasEncapsulatedExpression() || expression.hasRightParenthesis(); }
/** * {@inheritDoc} */ @Override public boolean hasEncapsulatedExpression() { return super.hasEncapsulatedExpression() || (asIdentifier != null) || hasDatabaseType(); }
/** * 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); } }