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
-
Constructor Summary
ModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionString[]
Returns the arguments that can help to format the localized problem.protected abstract String
encapsulatedExpressionInvalidKey
(T expression) Returns the message key for the problem describing that the encapsulated expression is invalid.protected int
encapsulatedExpressionLength
(T expression) Returns the length of the encapsulated expression.protected abstract String
encapsulatedExpressionMissingKey
(T expression) Returns the message key for the problem describing that the encapsulated expression is missing.boolean
hasLeftParenthesis
(T expression) Determines whether the givenAbstractEncapsulatedExpression
has the left parenthesis.boolean
hasRightParenthesis
(T expression) Determines whether the givenAbstractEncapsulatedExpression
has the right parenthesis.final String
identifier
(T expression) Returns the JPQL identifier of the givenAbstractEncapsulatedExpression
.protected boolean
isEncapsulatedExpressionMissing
(T expression) Determines whether there is an encapsulated expression or not.protected boolean
isEncapsulatedExpressionValid
(T expression) Determines whether the encapsulated expression is valid.protected int
lengthBeforeEncapsulatedExpression
(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, wait
Methods 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.AbstractEncapsulatedExpressionHelper
Returns the arguments that can help to format the localized problem.- Specified by:
arguments
in interfaceAbstractGrammarValidator.AbstractEncapsulatedExpressionHelper<T extends AbstractSingleEncapsulatedExpression>
- Parameters:
expression
- TheAbstractEncapsulatedExpression
being 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
- TheAbstractSingleEncapsulatedExpression
being validated- Returns:
- The key used to retrieve the localized message
-
encapsulatedExpressionLength
Returns the length of the encapsulated expression.- Parameters:
expression
-AbstractSingleEncapsulatedExpression
being 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
- TheAbstractSingleEncapsulatedExpression
being validated- Returns:
- The key used to retrieve the localized message
-
hasLeftParenthesis
Description copied from interface:AbstractGrammarValidator.AbstractEncapsulatedExpressionHelper
Determines whether the givenAbstractEncapsulatedExpression
has the left parenthesis.- Specified by:
hasLeftParenthesis
in interfaceAbstractGrammarValidator.AbstractEncapsulatedExpressionHelper<T extends AbstractSingleEncapsulatedExpression>
- Parameters:
expression
- TheAbstractEncapsulatedExpression
being validated- Returns:
true
if the left parenthesis was parsed
-
hasRightParenthesis
Description copied from interface:AbstractGrammarValidator.AbstractEncapsulatedExpressionHelper
Determines whether the givenAbstractEncapsulatedExpression
has the right parenthesis.- Specified by:
hasRightParenthesis
in interfaceAbstractGrammarValidator.AbstractEncapsulatedExpressionHelper<T extends AbstractSingleEncapsulatedExpression>
- Parameters:
expression
- TheAbstractEncapsulatedExpression
being validated- Returns:
true
if the right parenthesis was parsed
-
identifier
Description copied from interface:AbstractGrammarValidator.AbstractEncapsulatedExpressionHelper
Returns the JPQL identifier of the givenAbstractEncapsulatedExpression
.- Specified by:
identifier
in interfaceAbstractGrammarValidator.AbstractEncapsulatedExpressionHelper<T extends AbstractSingleEncapsulatedExpression>
- Parameters:
expression
- TheAbstractEncapsulatedExpression
being validated- Returns:
- The JPQL identifier of the given
AbstractEncapsulatedExpression
-
isEncapsulatedExpressionMissing
Determines whether there is an encapsulated expression or not.- Parameters:
expression
- TheAbstractSingleEncapsulatedExpression
being validated- Returns:
true
if the givenAbstractSingleEncapsulatedExpression
has an encapsulated expression;false
otherwise
-
isEncapsulatedExpressionValid
Determines whether the encapsulated expression is valid.- Parameters:
expression
- TheAbstractSingleEncapsulatedExpression
being validated- Returns:
true
if the encapsulated expression is valid;false
otherwise
-
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
- TheAbstractSingleEncapsulatedExpression
being validated- Returns:
- The length after the left parenthesis and before the encapsulated expression starts
-