Module eclipselink
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 ofAbstractGrammarValidator.AbstractSingleEncapsulatedExpressionHelper
which implements some of the methods since the behavior is the same for all subclasses ofAbstractSingleEncapsulatedExpression
.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSingleEncapsulatedExpressionHelper(AbstractGrammarValidator validator)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String[]
arguments(T expression)
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.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
-
-
-
-
Constructor Detail
-
AbstractSingleEncapsulatedExpressionHelper
protected AbstractSingleEncapsulatedExpressionHelper(AbstractGrammarValidator validator)
-
-
Method Detail
-
arguments
public String[] arguments(T expression)
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
protected abstract String encapsulatedExpressionInvalidKey(T expression)
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
protected int encapsulatedExpressionLength(T expression)
Returns the length of the encapsulated expression.- Parameters:
expression
-AbstractSingleEncapsulatedExpression
being validated- Returns:
- The length of the encapsulated expression
-
encapsulatedExpressionMissingKey
protected abstract String encapsulatedExpressionMissingKey(T expression)
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
public boolean hasLeftParenthesis(T expression)
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
public boolean hasRightParenthesis(T expression)
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
public final String identifier(T expression)
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
protected boolean isEncapsulatedExpressionMissing(T expression)
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
protected boolean isEncapsulatedExpressionValid(T expression)
Determines whether the encapsulated expression is valid.- Parameters:
expression
- TheAbstractSingleEncapsulatedExpression
being validated- Returns:
true
if the encapsulated expression is valid;false
otherwise
-
lengthBeforeEncapsulatedExpression
protected int lengthBeforeEncapsulatedExpression(T expression)
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
-
-