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 java.lang.Object implements AbstractGrammarValidator.AbstractEncapsulatedExpressionHelper<T>
The abstract implementation ofAbstractGrammarValidator.AbstractSingleEncapsulatedExpressionHelperwhich implements some of the methods since the behavior is the same for all subclasses ofAbstractSingleEncapsulatedExpression.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSingleEncapsulatedExpressionHelper(AbstractGrammarValidator validator)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String[]arguments(T expression)Returns the arguments that can help to format the localized problem.protected abstract java.lang.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 java.lang.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.java.lang.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, 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 java.lang.String[] arguments(T expression)
Returns 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
protected abstract java.lang.String encapsulatedExpressionInvalidKey(T expression)
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
protected int encapsulatedExpressionLength(T expression)
Returns the length of the encapsulated expression.- Parameters:
expression-AbstractSingleEncapsulatedExpressionbeing validated- Returns:
- The length of the encapsulated expression
-
encapsulatedExpressionMissingKey
protected abstract java.lang.String encapsulatedExpressionMissingKey(T expression)
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
public boolean hasLeftParenthesis(T expression)
Determines 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
public boolean hasRightParenthesis(T expression)
Determines 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
public final java.lang.String identifier(T expression)
Returns 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
protected boolean isEncapsulatedExpressionMissing(T expression)
Determines whether there is an encapsulated expression or not.- Parameters:
expression- TheAbstractSingleEncapsulatedExpressionbeing validated- Returns:
trueif the givenAbstractSingleEncapsulatedExpressionhas an encapsulated expression;falseotherwise
-
isEncapsulatedExpressionValid
protected boolean isEncapsulatedExpressionValid(T expression)
Determines whether the encapsulated expression is valid.- Parameters:
expression- TheAbstractSingleEncapsulatedExpressionbeing validated- Returns:
trueif the encapsulated expression is valid;falseotherwise
-
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- TheAbstractSingleEncapsulatedExpressionbeing validated- Returns:
- The length after the left parenthesis and before the encapsulated expression starts
-
-