public class DefaultSemanticValidator extends AbstractSemanticValidator
For instance, the function AVG accepts a state field path. The property it represents has
to be of numeric type. AVG(e.name) is parsable but is not semantically valid because the
type of name is a string (the property signature is: "private String name
").
Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
DefaultGrammarValidator
Modifier and Type | Class and Description |
---|---|
protected class |
DefaultSemanticValidator.BooleanTypeValidator
This visitor validates expression that is a boolean literal to make sure the type is a
Boolean.
|
protected class |
DefaultSemanticValidator.NullValueVisitor |
protected class |
DefaultSemanticValidator.NumericTypeValidator
This visitor validates expression that is a numeric literal to make sure the type is an
instance of Number.
|
protected class |
DefaultSemanticValidator.ResultVariableInOrderByVisitor |
protected class |
DefaultSemanticValidator.StringTypeValidator
This visitor validates that the
Expression is a string primary and to make sure the
type is String. |
protected class |
DefaultSemanticValidator.TypeValidator
The basic validator for validating the type of an
Expression . |
protected class |
DefaultSemanticValidator.UpdateClauseAbstractSchemaNameFinder |
AbstractSemanticValidator.CollectionValuedPathExpressionVisitor, AbstractSemanticValidator.ComparingEntityTypeLiteralVisitor, AbstractSemanticValidator.ComparisonExpressionVisitor, AbstractSemanticValidator.FirstDeclarationVisitor, AbstractSemanticValidator.InItemsVisitor, AbstractSemanticValidator.PathType, AbstractSemanticValidator.StateFieldPathExpressionVisitor, AbstractSemanticValidator.SubqueryFirstDeclarationVisitor, AbstractSemanticValidator.TopLevelFirstDeclarationVisitor
AbstractValidator.BypassChildCollectionExpressionVisitor, AbstractValidator.BypassParentSubExpressionVisitor, AbstractValidator.ChildrenCollectorVisitor, AbstractValidator.JPQLQueryBNFValidator, AbstractValidator.NestedArrayVisitor, AbstractValidator.OwningClauseVisitor, AbstractValidator.OwningStatementVisitor, AbstractValidator.SubqueryVisitor
Modifier and Type | Field and Description |
---|---|
protected DefaultSemanticValidator.NullValueVisitor |
nullValueVisitor
This validator determines whether the
Expression visited represents
Expression.NULL . |
protected DefaultSemanticValidator.UpdateClauseAbstractSchemaNameFinder |
updateClauseAbstractSchemaNameFinder
This finder is responsible to retrieve the abstract schema name from the UPDATE range
declaration expression.
|
protected java.util.Map<java.lang.Class<? extends DefaultSemanticValidator.TypeValidator>,DefaultSemanticValidator.TypeValidator> |
validators
The
TypeVlidators mapped to their Java class. |
collectionValuedPathExpressionVisitor, helper, registerIdentificationVariable, stateFieldPathExpressionVisitor, usedIdentificationVariables, virtualIdentificationVariableFinder
Constructor and Description |
---|
DefaultSemanticValidator(JPQLQueryContext queryContext)
Creates a new
DefaultSemanticValidator . |
DefaultSemanticValidator(SemanticValidatorHelper helper)
Creates a new
DefaultSemanticValidator . |
Modifier and Type | Method and Description |
---|---|
protected boolean |
areTypesEquivalent(java.lang.Object[] typeDeclarations1,
java.lang.Object[] typeDeclarations2) |
protected LiteralVisitor |
buildLiteralVisitor()
Creates the visitor that can retrieve some information about various literal.
|
protected AbstractValidator.OwningClauseVisitor |
buildOwningClauseVisitor()
Creates the visitor that traverses the parent hierarchy of any
Expression and stops at
the first Expression that is a clause. |
protected DefaultSemanticValidator.ResultVariableInOrderByVisitor |
buildResultVariableInOrderByVisitor() |
protected AbstractSchemaName |
findAbstractSchemaName(UpdateItem expression) |
protected DefaultSemanticValidator.NullValueVisitor |
getNullValueVisitor() |
protected java.lang.Object |
getType(Expression expression) |
protected ITypeHelper |
getTypeHelper() |
protected DefaultSemanticValidator.UpdateClauseAbstractSchemaNameFinder |
getUpdateClauseAbstractSchemaNameFinder() |
protected DefaultSemanticValidator.TypeValidator |
getValidator(java.lang.Class<? extends DefaultSemanticValidator.TypeValidator> validatorClass) |
protected void |
initialize()
Initializes this validator.
|
protected boolean |
isBooleanType(Expression expression)
Determines whether the given
Expression is of the correct type based on these rules:
The Expression returns a boolean value;
|
protected boolean |
isComparisonEquivalentType(Expression expression1,
Expression expression2) |
protected boolean |
isEquivalentBetweenType(Expression expression1,
Expression expression2) |
protected boolean |
isIntegralType(Expression expression)
Determines whether the given
Expression is of the correct type based on these rules:
The Expression 's type is an integral type (long or integer). |
protected boolean |
isNullValue(Expression expression) |
protected boolean |
isNumericType(Expression expression)
Determines whether the given
Expression is of the correct type based on these rules:
The Expression returns a numeric value;
|
protected boolean |
isStringType(Expression expression)
Determines whether the given
Expression is of the correct type based on these rules:
The Expression 's type is a string type. |
protected boolean |
isValid(Expression expression,
java.lang.Class<? extends DefaultSemanticValidator.TypeValidator> validatorClass)
Determines whether the given
Expression is of the correct type by using the
DefaultSemanticValidator.TypeValidator . |
protected boolean |
isValidWithFindQueryBNF(AbstractExpression expression,
java.lang.String queryBNF) |
protected AbstractSemanticValidator.PathType |
selectClausePathExpressionPathType()
Returns the type of path expression that is allowed in the
SELECT clause. |
protected boolean |
validateAbsExpression(AbsExpression expression)
Validates the encapsulated expression of the given
ABS expression. |
protected int |
validateArithmeticExpression(ArithmeticExpression expression,
java.lang.String leftExpressionWrongTypeMessageKey,
java.lang.String rightExpressionWrongTypeMessageKey)
Validates the type of the left and right expressions defined by the given
ArithmeticExpression . |
protected boolean |
validateAvgFunction(AvgFunction expression)
Validates the encapsulated expression of the given
AVG expression. |
protected int |
validateBetweenExpression(BetweenExpression expression)
Validates the given
BetweenExpression . |
protected boolean |
validateBooleanType(Expression expression,
java.lang.String messageKey)
Determines whether the given
Expression is of the correct type based on these rules:
The Expression returns a boolean value;
The Expression 's type is a boolean type. |
protected int |
validateCollectionMemberExpression(CollectionMemberExpression expression)
Validates the given
CollectionMemberExpression . |
protected boolean |
validateComparisonExpression(ComparisonExpression expression)
Validates the left and right expressions of the given
ComparisonExpression . |
protected boolean |
validateConcatExpression(ConcatExpression expression)
Validates the encapsulated expression of the given
CONCAT expression. |
protected void |
validateConstructorExpression(ConstructorExpression expression)
Validates the given
ConstructorExpression . |
protected void |
validateCountFunction(CountFunction expression)
Validates the given
CountFunction . |
protected void |
validateEntryExpression(EntryExpression expression)
Validates the given
EntryExpression . |
protected boolean |
validateIdentificationVariable(IdentificationVariable expression,
java.lang.String variable)
Validates the given identification variable.
|
protected boolean |
validateIntegralType(Expression expression,
java.lang.String queryBNF,
java.lang.String messageKey)
Determines whether the given
Expression is of the correct type based on these rules:
The Expression returns a integral value;
The Expression 's type is an integral type (long or integer). |
protected void |
validateKeyExpression(KeyExpression expression)
Validates the given
KeyExpression . |
protected boolean |
validateLengthExpression(LengthExpression expression)
Validates the encapsulated expression of the given
LENGTH expression. |
protected int |
validateLocateExpression(LocateExpression expression)
Validates the encapsulated expression of the given
LOCATE expression. |
protected boolean |
validateLowerExpression(LowerExpression expression)
Validates the encapsulated expression of the given
LOWER expression. |
protected void |
validateMapIdentificationVariable(EncapsulatedIdentificationVariableExpression expression) |
protected int |
validateModExpression(ModExpression expression)
Validates the encapsulated expression of the given
MOD expression. |
protected void |
validateNotExpression(NotExpression expression)
Validates the given
NotExpression . |
protected void |
validateNullComparisonExpression(NullComparisonExpression expression)
Validates the given
NullComparisonExpression . |
protected boolean |
validateNumericType(Expression expression,
java.lang.String messageKey)
Determines whether the given
Expression is of the correct type based on these rules:
The Expression returns a numeric value;
The Expression 's type is an numeric type. |
protected boolean |
validateSqrtExpression(SqrtExpression expression)
Validates the encapsulated expression of the given
SQRT expression. |
protected boolean |
validateStringType(Expression expression,
java.lang.String messageKey)
Determines whether the given
Expression is of the correct type based on these rules:
The Expression returns a String value;
The Expression 's type is a String type. |
protected int |
validateSubstringExpression(SubstringExpression expression)
Validates the encapsulated expression of the given
SUBSTRING expression. |
protected boolean |
validateSumFunction(SumFunction expression)
Validates the encapsulated expression of the given
MOD expression. |
protected boolean |
validateUpdateItem(UpdateItem expression)
Validates the given
UpdateItem by validating the traversability of the path
expression. |
protected void |
validateUpdateItemTypes(UpdateItem expression,
java.lang.Object type) |
protected boolean |
validateUpperExpression(UpperExpression expression)
Validates the encapsulated expression of the given
UPPER expression. |
protected void |
validateValueExpression(ValueExpression expression)
Validates the given
ValueExpression . |
buildComparingEntityTypeLiteralVisitor, buildInItemsVisitor, buildSubqueryFirstDeclarationVisitor, buildTopLevelFirstDeclarationVisitor, dispose, findVirtualIdentificationVariable, getCollectionValuedPathExpression, getCollectionValuedPathExpressionVisitor, getComparingEntityTypeLiteralVisitor, getComparisonExpressionVisitor, getGrammar, getInItemsVisitor, getStateFieldPathExpression, getStateFieldPathExpressionVisitor, getVirtualIdentificationVariableFinder, isComparingEntityTypeLiteral, isIdentificationVariableDeclaredAfter, isIdentificationVariableValidInComparison, isOrderComparison, isValid, subqueryFirstDeclarationVisitor, topLevelFirstDeclarationVisitor, updateStatus, validateAbstractFromClause, validateAbstractSchemaName, validateAdditionExpression, validateAllOrAnyExpression, validateAndExpression, validateArithmeticExpression, validateCaseExpression, validateCoalesceExpression, validateCollectionMemberDeclaration, validateCollectionValuedPathExpression, validateDateTime, validateDeleteClause, validateDeleteStatement, validateDivisionExpression, validateEntityTypeLiteral, validateExistsExpression, validateFirstDeclaration, validateFromClause, validateFunctionExpression, validateFunctionPathExpression, validateFunctionPathExpression, validateGroupByClause, validateHavingClause, validateIdentificationVariable, validateIdentificationVariableDeclaration, validateIdentificationVariables, validateIndexExpression, validateInExpression, validateJoin, validateJoinsIdentificationVariable, validateLikeExpression, validateMaxFunction, validateMinFunction, validateMultiplicationExpression, validateNullIfExpression, validateObjectExpression, validateOnClause, validateOrderByClause, validateOrderByItem, validateOrExpression, validateRangeVariableDeclaration, validateRangeVariableDeclarationRootObject, validateResultVariable, validateSelectClause, validateSelectStatement, validateSimpleFromClause, validateSimpleSelectClause, validateSimpleSelectStatement, validateSizeExpression, validateStateFieldPathExpression, validateSubtractionExpression, validateThirdPartyStateFieldPathExpression, validateTreatExpression, validateTrimExpression, validateTypeExpression, validateUpdateClause, validateUpdateStatement, validateWhenClause, validateWhereClause, validPathExpressionTypeForCountFunction, validPathExpressionTypeForInExpression, validPathExpressionTypeForInItem, validPathExpressionTypeForStringExpression, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
addProblem, addProblem, addProblem, addProblem, buildChildrenCollector, buildNestedArrayVisitor, buildOwningStatementVisitor, buildProblem, buildSubqueryVisitor, getBypassChildCollectionExpressionVisitor, getBypassParentSubExpressionVisitor, getChildren, getChildrenCollectorVisitor, getExpressionRegistry, getExpressionValidator, getJPAVersion, getJPQLQueryBNFValidator, getJPQLQueryBNFValidator, getLiteralVisitor, getNestedArrayVisitor, getOwningClauseVisitor, getOwningStatementVisitor, getProvider, getProviderVersion, getQueryBNF, getSubqueryVisitor, isNestedArray, isSubquery, isValid, isValid, isValid, isValidWithChildCollectionBypass, isWithinSubquery, isWithinTopLevelQuery, length, literal, nestedArraySize, position, problemsSize, setProblems, visit
protected DefaultSemanticValidator.NullValueVisitor nullValueVisitor
Expression
visited represents
Expression.NULL
.protected DefaultSemanticValidator.UpdateClauseAbstractSchemaNameFinder updateClauseAbstractSchemaNameFinder
protected java.util.Map<java.lang.Class<? extends DefaultSemanticValidator.TypeValidator>,DefaultSemanticValidator.TypeValidator> validators
TypeVlidators
mapped to their Java class. Those validators validate
any Expression
by making sure its type matches the desired type.public DefaultSemanticValidator(JPQLQueryContext queryContext)
DefaultSemanticValidator
.queryContext
- The context used to query information about the JPQL queryjava.lang.NullPointerException
- The given JPQLQueryContext
cannot be null
public DefaultSemanticValidator(SemanticValidatorHelper helper)
DefaultSemanticValidator
.helper
- The given helper allows the validator to access the JPA artifacts without using
Hermes SPI directlyjava.lang.NullPointerException
- The given SemanticValidatorHelper
cannot be null
protected boolean areTypesEquivalent(java.lang.Object[] typeDeclarations1, java.lang.Object[] typeDeclarations2)
protected LiteralVisitor buildLiteralVisitor()
buildLiteralVisitor
in class AbstractValidator
LiteralVisitor
protected AbstractValidator.OwningClauseVisitor buildOwningClauseVisitor()
Expression
and stops at
the first Expression
that is a clause.buildOwningClauseVisitor
in class AbstractValidator
AbstractValidator.OwningClauseVisitor
protected DefaultSemanticValidator.ResultVariableInOrderByVisitor buildResultVariableInOrderByVisitor()
protected AbstractSchemaName findAbstractSchemaName(UpdateItem expression)
protected DefaultSemanticValidator.NullValueVisitor getNullValueVisitor()
protected java.lang.Object getType(Expression expression)
protected ITypeHelper getTypeHelper()
protected DefaultSemanticValidator.UpdateClauseAbstractSchemaNameFinder getUpdateClauseAbstractSchemaNameFinder()
protected DefaultSemanticValidator.TypeValidator getValidator(java.lang.Class<? extends DefaultSemanticValidator.TypeValidator> validatorClass)
protected void initialize()
initialize
in class AbstractSemanticValidator
protected boolean isBooleanType(Expression expression)
Expression
is of the correct type based on these rules:
Expression
returns a boolean value;expression
- The Expression
to validatetrue
if the given Expression
passes the checks; false
otherwiseprotected boolean isComparisonEquivalentType(Expression expression1, Expression expression2)
protected boolean isEquivalentBetweenType(Expression expression1, Expression expression2)
protected boolean isIntegralType(Expression expression)
Expression
is of the correct type based on these rules:
Expression
's type is an integral type (long or integer).expression
- The Expression
to validatetrue
if the given Expression
passes the checks; false
otherwiseprotected boolean isNullValue(Expression expression)
protected boolean isNumericType(Expression expression)
Expression
is of the correct type based on these rules:
Expression
returns a numeric value;expression
- The Expression
to validatetrue
if the given Expression
passes the checks; false
otherwiseprotected boolean isStringType(Expression expression)
Expression
is of the correct type based on these rules:
Expression
's type is a string type.expression
- The Expression
to validatetrue
if the given Expression
passes the checks; false
otherwiseprotected boolean isValid(Expression expression, java.lang.Class<? extends DefaultSemanticValidator.TypeValidator> validatorClass)
Expression
is of the correct type by using the
DefaultSemanticValidator.TypeValidator
.expression
- The Expression
to validatevalidatorClass
- The Java class of the DefaultSemanticValidator.TypeValidator
that will determine if the
given Expression
has the right typetrue
if the given Expression
passes the checks; false
otherwiseprotected boolean isValidWithFindQueryBNF(AbstractExpression expression, java.lang.String queryBNF)
protected AbstractSemanticValidator.PathType selectClausePathExpressionPathType()
SELECT
clause.selectClausePathExpressionPathType
in class AbstractSemanticValidator
protected boolean validateAbsExpression(AbsExpression expression)
ABS
expression. The
test to perform is:
validateAbsExpression
in class AbstractSemanticValidator
expression
- The AbsExpression
to validate by validating its encapsulated
expressionfalse
if the encapsulated expression was validated and is invalid;
true
otherwiseprotected int validateArithmeticExpression(ArithmeticExpression expression, java.lang.String leftExpressionWrongTypeMessageKey, java.lang.String rightExpressionWrongTypeMessageKey)
ArithmeticExpression
.
The test to perform is:
validateArithmeticExpression
in class AbstractSemanticValidator
expression
- The ArithmeticExpression
to validateleftExpressionWrongTypeMessageKey
- The key used to describe the left expression does not
have a valid typerightExpressionWrongTypeMessageKey
- The key used to describe the right expression does
not have a valid typeAbstractSemanticValidator.isValid(int, int)
can be used to
determine the validation status of an expression based on its positionprotected boolean validateAvgFunction(AvgFunction expression)
AVG
expression. The
test to perform is:
validateAvgFunction
in class AbstractSemanticValidator
expression
- The AvgFunction
to validate by validating its encapsulated expressionfalse
if the encapsulated expression was validated and is invalid;
true
otherwiseprotected int validateBetweenExpression(BetweenExpression expression)
BetweenExpression
. The test to perform is:
validateBetweenExpression
in class AbstractSemanticValidator
expression
- The BetweenExpression
to validateprotected boolean validateBooleanType(Expression expression, java.lang.String messageKey)
Expression
is of the correct type based on these rules:
Expression
returns a boolean value;Expression
's type is a boolean type.expression
- The Expression
to validatemessageKey
- The key used to retrieve the localized message describing the problemprotected int validateCollectionMemberExpression(CollectionMemberExpression expression)
CollectionMemberExpression
. Only the collection-valued path
expression is validated.validateCollectionMemberExpression
in class AbstractSemanticValidator
expression
- The CollectionMemberExpression
to validateAbstractSemanticValidator.isValid(int, int)
can be used to
determine the validation status of an expression based on its positionprotected boolean validateComparisonExpression(ComparisonExpression expression)
ComparisonExpression
. The tests
to perform are:
validateComparisonExpression
in class AbstractSemanticValidator
expression
- The ConcatExpression
to validate by validating its
left and right expressionstrue
if the two expressions pass the rules defined by this method; false
otherwiseprotected boolean validateConcatExpression(ConcatExpression expression)
CONCAT
expression.
The tests to perform are:
validateConcatExpression
in class AbstractSemanticValidator
expression
- The ConcatExpression
to validate by validating its encapsulated expressionfalse
if the first encapsulated expression was validated and is invalid;
true
otherwiseprotected void validateConstructorExpression(ConstructorExpression expression)
ConstructorExpression
. The default behavior does not require to
semantically validate it.validateConstructorExpression
in class AbstractSemanticValidator
expression
- The ConstructorExpression
to validateprotected void validateCountFunction(CountFunction expression)
CountFunction
. The default behavior does not require to
semantically validate it.validateCountFunction
in class AbstractSemanticValidator
expression
- The CountFunction
to validateprotected void validateEntryExpression(EntryExpression expression)
EntryExpression
. The default behavior does not require to
semantically validate it.validateEntryExpression
in class AbstractSemanticValidator
expression
- The EntryExpression
to validateprotected boolean validateIdentificationVariable(IdentificationVariable expression, java.lang.String variable)
validateIdentificationVariable
in class AbstractSemanticValidator
expression
- The IdentificationVariable
that is being visitedvariable
- The actual identification variable, which is never an empty stringtrue
if the given identification variable is valid; false
otherwiseprotected boolean validateIntegralType(Expression expression, java.lang.String queryBNF, java.lang.String messageKey)
Expression
is of the correct type based on these rules:
Expression
returns a integral value;Expression
's type is an integral type (long or integer).expression
- The Expression
to validatequeryBNF
- The unique identifier of the query BNF used to validate the typemessageKey
- The key used to retrieve the localized message describing the problemfalse
if the given expression was validated and is invalid;
true
otherwiseprotected void validateKeyExpression(KeyExpression expression)
KeyExpression
. The default behavior does not require to
semantically validate it.validateKeyExpression
in class AbstractSemanticValidator
expression
- The KeyExpression
to validateprotected boolean validateLengthExpression(LengthExpression expression)
LENGTH
expression. The
test to perform is:
validateLengthExpression
in class AbstractSemanticValidator
expression
- The LengthExpression
to validate by validating its encapsulated expressionfalse
if the encapsulated expression was validated and is invalid;
true
otherwiseprotected int validateLocateExpression(LocateExpression expression)
LOCATE
expression. The
test to perform is:
validateLocateExpression
in class AbstractSemanticValidator
expression
- The LocateExpression
to validate by validating its encapsulated expressionAbstractSemanticValidator.isValid(int, int)
can be used to
determine the validation status of an expression based on its positionprotected boolean validateLowerExpression(LowerExpression expression)
LOWER
expression. The
test to perform is:
validateLowerExpression
in class AbstractSemanticValidator
expression
- The LowerExpression
to validate by validating its encapsulated expressionfalse
if the encapsulated expression was validated and is invalid;
true
otherwiseprotected void validateMapIdentificationVariable(EncapsulatedIdentificationVariableExpression expression)
protected int validateModExpression(ModExpression expression)
MOD
expression. The
test to perform is:
validateModExpression
in class AbstractSemanticValidator
expression
- The ModExpression
to validate by validating its encapsulated expressionAbstractSemanticValidator.isValid(int, int)
can be used to
determine the validation status of an expression based on its positionprotected void validateNotExpression(NotExpression expression)
NotExpression
. The default behavior does not require to
semantically validate it.validateNotExpression
in class AbstractSemanticValidator
expression
- The NotExpression
to validateprotected void validateNullComparisonExpression(NullComparisonExpression expression)
NullComparisonExpression
. The default behavior does not require to
semantically validate it.validateNullComparisonExpression
in class AbstractSemanticValidator
expression
- The NullComparisonExpression
to validateprotected boolean validateNumericType(Expression expression, java.lang.String messageKey)
Expression
is of the correct type based on these rules:
Expression
returns a numeric value;Expression
's type is an numeric type.expression
- The Expression
to validatemessageKey
- The key used to retrieve the localized message describing the problemfalse
if the given expression was validated and is invalid;
true
otherwiseprotected boolean validateSqrtExpression(SqrtExpression expression)
SQRT
expression. The
test to perform is:
validateSqrtExpression
in class AbstractSemanticValidator
expression
- The SqrtExpression
to validate by validating its encapsulated expressionfalse
if the encapsulated expression was validated and is invalid;
true
otherwiseprotected boolean validateStringType(Expression expression, java.lang.String messageKey)
Expression
is of the correct type based on these rules:
Expression
returns a String value;Expression
's type is a String type.expression
- The Expression
to validatemessageKey
- The key used to retrieve the localized message describing the problemfalse
if the given expression was validated and is invalid;
true
otherwiseprotected int validateSubstringExpression(SubstringExpression expression)
SUBSTRING
expression.
The test to perform is:
validateSubstringExpression
in class AbstractSemanticValidator
expression
- The SubstringExpression
to validate by validating its encapsulated expressionAbstractSemanticValidator.isValid(int, int)
can be used to
determine the validation status of an expression based on its positionprotected boolean validateSumFunction(SumFunction expression)
MOD
expression. The
test to perform is:
validateSumFunction
in class AbstractSemanticValidator
expression
- The ModExpression
to validate by validating its encapsulated expressionfalse
if the encapsulated expression was validated and is invalid;
true
otherwiseprotected boolean validateUpdateItem(UpdateItem expression)
UpdateItem
by validating the traversability of the path
expression. The path expression is valid if it follows one of the following rules:
validateUpdateItem
in class AbstractSemanticValidator
expression
- UpdateItem
to validate its path expressiontrue
if the path expression is valid; false
otherwiseprotected void validateUpdateItemTypes(UpdateItem expression, java.lang.Object type)
protected boolean validateUpperExpression(UpperExpression expression)
UPPER
expression. The
test to perform is:
validateUpperExpression
in class AbstractSemanticValidator
expression
- The UpperExpression
to validate by validating its encapsulated expressionfalse
if the encapsulated expression was validated and is invalid;
true
otherwiseprotected void validateValueExpression(ValueExpression expression)
ValueExpression
. The default behavior does not require to
semantically validate it.validateValueExpression
in class AbstractSemanticValidator
expression
- The ValueExpression
to validate