Package org.eclipse.persistence.jpa.jpql
Class AbstractGrammarValidator.AbstractSingleEncapsulatedExpressionHelper<T extends AbstractSingleEncapsulatedExpression>
java.lang.Object
org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator.AbstractSingleEncapsulatedExpressionHelper<T>
- All Implemented Interfaces:
AbstractGrammarValidator.AbstractEncapsulatedExpressionHelper<T>
- Enclosing class:
AbstractGrammarValidator
protected abstract static class AbstractGrammarValidator.AbstractSingleEncapsulatedExpressionHelper<T extends AbstractSingleEncapsulatedExpression>
extends Object
implements AbstractGrammarValidator.AbstractEncapsulatedExpressionHelper<T>
The abstract implementation of
AbstractGrammarValidator.AbstractSingleEncapsulatedExpressionHelper which
implements some of the methods since the behavior is the same for all subclasses of
AbstractSingleEncapsulatedExpression.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionString[]Returns the arguments that can help to format the localized problem.protected abstract StringencapsulatedExpressionInvalidKey(T expression) Returns the message key for the problem describing that the encapsulated expression is invalid.protected intencapsulatedExpressionLength(T expression) Returns the length of the encapsulated expression.protected abstract StringencapsulatedExpressionMissingKey(T expression) Returns the message key for the problem describing that the encapsulated expression is missing.booleanhasLeftParenthesis(T expression) Determines whether the givenAbstractEncapsulatedExpressionhas the left parenthesis.booleanhasRightParenthesis(T expression) Determines whether the givenAbstractEncapsulatedExpressionhas the right parenthesis.final Stringidentifier(T expression) Returns the JPQL identifier of the givenAbstractEncapsulatedExpression.protected booleanisEncapsulatedExpressionMissing(T expression) Determines whether there is an encapsulated expression or not.protected booleanisEncapsulatedExpressionValid(T expression) Determines whether the encapsulated expression is valid.protected intlengthBeforeEncapsulatedExpression(T expression) Returns the length after the left parenthesis and before the encapsulated expression starts.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator.AbstractEncapsulatedExpressionHelper
leftParenthesisMissingKey, rightParenthesisMissingKey
-
Field Details
-
validator
-
-
Constructor Details
-
AbstractSingleEncapsulatedExpressionHelper
-
-
Method Details
-
arguments
Description copied from interface:AbstractGrammarValidator.AbstractEncapsulatedExpressionHelperReturns the arguments that can help to format the localized problem.- Specified by:
argumentsin interfaceAbstractGrammarValidator.AbstractEncapsulatedExpressionHelper<T extends AbstractSingleEncapsulatedExpression>- Parameters:
expression- TheAbstractEncapsulatedExpressionbeing validated- Returns:
- The list of arguments used to complete the localized problem
-
encapsulatedExpressionInvalidKey
Returns the message key for the problem describing that the encapsulated expression is invalid.- Parameters:
expression- TheAbstractSingleEncapsulatedExpressionbeing validated- Returns:
- The key used to retrieve the localized message
-
encapsulatedExpressionLength
Returns the length of the encapsulated expression.- Parameters:
expression-AbstractSingleEncapsulatedExpressionbeing validated- Returns:
- The length of the encapsulated expression
-
encapsulatedExpressionMissingKey
Returns the message key for the problem describing that the encapsulated expression is missing.- Parameters:
expression- TheAbstractSingleEncapsulatedExpressionbeing validated- Returns:
- The key used to retrieve the localized message
-
hasLeftParenthesis
Description copied from interface:AbstractGrammarValidator.AbstractEncapsulatedExpressionHelperDetermines whether the givenAbstractEncapsulatedExpressionhas the left parenthesis.- Specified by:
hasLeftParenthesisin interfaceAbstractGrammarValidator.AbstractEncapsulatedExpressionHelper<T extends AbstractSingleEncapsulatedExpression>- Parameters:
expression- TheAbstractEncapsulatedExpressionbeing validated- Returns:
trueif the left parenthesis was parsed
-
hasRightParenthesis
Description copied from interface:AbstractGrammarValidator.AbstractEncapsulatedExpressionHelperDetermines whether the givenAbstractEncapsulatedExpressionhas the right parenthesis.- Specified by:
hasRightParenthesisin interfaceAbstractGrammarValidator.AbstractEncapsulatedExpressionHelper<T extends AbstractSingleEncapsulatedExpression>- Parameters:
expression- TheAbstractEncapsulatedExpressionbeing validated- Returns:
trueif the right parenthesis was parsed
-
identifier
Description copied from interface:AbstractGrammarValidator.AbstractEncapsulatedExpressionHelperReturns the JPQL identifier of the givenAbstractEncapsulatedExpression.- Specified by:
identifierin interfaceAbstractGrammarValidator.AbstractEncapsulatedExpressionHelper<T extends AbstractSingleEncapsulatedExpression>- Parameters:
expression- TheAbstractEncapsulatedExpressionbeing validated- Returns:
- The JPQL identifier of the given
AbstractEncapsulatedExpression
-
isEncapsulatedExpressionMissing
Determines whether there is an encapsulated expression or not.- Parameters:
expression- TheAbstractSingleEncapsulatedExpressionbeing validated- Returns:
trueif the givenAbstractSingleEncapsulatedExpressionhas an encapsulated expression;falseotherwise
-
isEncapsulatedExpressionValid
Determines whether the encapsulated expression is valid.- Parameters:
expression- TheAbstractSingleEncapsulatedExpressionbeing validated- Returns:
trueif the encapsulated expression is valid;falseotherwise
-
lengthBeforeEncapsulatedExpression
Returns the length after the left parenthesis and before the encapsulated expression starts.By default, there is no text after the left parenthesis and the encapsulated expression but there are exceptions, such as the functions (AVG, COUNT, MIN, MAX, SUM).
- Parameters:
expression- TheAbstractSingleEncapsulatedExpressionbeing validated- Returns:
- The length after the left parenthesis and before the encapsulated expression starts
-