EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.jpa.jpql
Class DefaultSemanticValidator

java.lang.Object
  extended by org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
      extended by org.eclipse.persistence.jpa.jpql.AbstractValidator
          extended by org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator
              extended by org.eclipse.persistence.jpa.jpql.DefaultSemanticValidator
All Implemented Interfaces:
ExpressionVisitor

public class DefaultSemanticValidator
extends AbstractSemanticValidator

This validator is responsible to gather the problems found in a JPQL query by validating the content to make sure it is semantically valid. The grammar is not validated by this visitor.

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.

Version:
2.4.2
See Also:
DefaultGrammarValidator
Author:
Pascal Filion
Since:
2.3

Nested Class Summary
protected  class DefaultSemanticValidator.BooleanTypeValidator
          This visitor validates expression that is a boolean literal to make sure the type is a Boolean.
protected static class DefaultSemanticValidator.CollectionValuedPathExpressionVisitor
           
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 static class DefaultSemanticValidator.StateFieldPathExpressionVisitor
          This visitor is meant to retrieve an DefaultSemanticValidator.StateFieldPathExpressionVisitor if the visited Expression is that object.
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
           
protected static class DefaultSemanticValidator.VirtualIdentificationVariableFinder
          This visitor traverses the parsed tree and retrieves the IdentificationVariable defined for a range variable declaration.
 
Nested classes/interfaces inherited from class org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator
AbstractSemanticValidator.ComparingEntityTypeLiteralVisitor, AbstractSemanticValidator.ComparisonExpressionVisitor, AbstractSemanticValidator.FirstDeclarationVisitor, AbstractSemanticValidator.PathType, AbstractSemanticValidator.SubqueryFirstDeclarationVisitor, AbstractSemanticValidator.TopLevelFirstDeclarationVisitor
 
Nested classes/interfaces inherited from class org.eclipse.persistence.jpa.jpql.AbstractValidator
AbstractValidator.BypassChildCollectionExpressionVisitor, AbstractValidator.BypassParentSubExpressionVisitor, AbstractValidator.ChildrenCollectorVisitor, AbstractValidator.JPQLQueryBNFValidator, AbstractValidator.OwningClauseVisitor, AbstractValidator.OwningStatementVisitor, AbstractValidator.SubqueryVisitor
 
Field Summary
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.
 
Fields inherited from class org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator
collectionValuedPathExpressionVisitor, helper, registerIdentificationVariable, stateFieldPathExpressionVisitor, usedIdentificationVariables, virtualIdentificationVariableFinder
 
Constructor Summary
DefaultSemanticValidator(JPQLQueryContext queryContext)
          Creates a new DefaultSemanticValidator.
DefaultSemanticValidator(SemanticValidatorHelper helper)
          Creates a new DefaultSemanticValidator.
 
Method Summary
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.BooleanTypeValidator.
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.
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator
buildComparingEntityTypeLiteralVisitor, buildSubqueryFirstDeclarationVisitor, buildTopLevelFirstDeclarationVisitor, dispose, findVirtualIdentificationVariable, getCollectionValuedPathExpression, getCollectionValuedPathExpressionVisitor, getComparingEntityTypeLiteralVisitor, getComparisonExpressionVisitor, getGrammar, 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, 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, validateTreatExpression, validateTrimExpression, validateTypeExpression, validateUpdateClause, validateUpdateStatement, validateWhenClause, validateWhereClause, validPathExpressionTypeForInExpression, 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
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.AbstractValidator
addProblem, addProblem, addProblem, addProblem, buildChildrenCollector, buildOwningStatementVisitor, buildProblem, buildSubqueryVisitor, getBypassChildCollectionExpressionVisitor, getBypassParentSubExpressionVisitor, getChildren, getChildrenCollectorVisitor, getExpressionRegistry, getExpressionValidator, getJPAVersion, getJPQLQueryBNFValidator, getJPQLQueryBNFValidator, getLiteralVisitor, getOwningClauseVisitor, getOwningStatementVisitor, getProviderVersion, getQueryBNF, getSubqueryVisitor, isSubquery, isValid, isValid, isValid, isValidWithChildCollectionBypass, isWithinSubquery, isWithinTopLevelQuery, length, literal, position, problemsSize, setProblems, visit
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nullValueVisitor

protected DefaultSemanticValidator.NullValueVisitor nullValueVisitor
This validator determines whether the Expression visited represents Expression.NULL.


updateClauseAbstractSchemaNameFinder

protected DefaultSemanticValidator.UpdateClauseAbstractSchemaNameFinder updateClauseAbstractSchemaNameFinder
This finder is responsible to retrieve the abstract schema name from the UPDATE range declaration expression.


validators

protected java.util.Map<java.lang.Class<? extends DefaultSemanticValidator.TypeValidator>,DefaultSemanticValidator.TypeValidator> validators
The TypeVlidators mapped to their Java class. Those validators validate any Expression by making sure its type matches the desired type.

Constructor Detail

DefaultSemanticValidator

public DefaultSemanticValidator(JPQLQueryContext queryContext)
Creates a new DefaultSemanticValidator.

Parameters:
queryContext - The context used to query information about the JPQL query
Throws:
java.lang.NullPointerException - The given JPQLQueryContext cannot be null

DefaultSemanticValidator

public DefaultSemanticValidator(SemanticValidatorHelper helper)
Creates a new DefaultSemanticValidator.

Parameters:
helper - The given helper allows the validator to access the JPA artifacts without using Hermes SPI directly
Throws:
java.lang.NullPointerException - The given SemanticValidatorHelper cannot be null
Since:
2.4
Method Detail

areTypesEquivalent

protected boolean areTypesEquivalent(java.lang.Object[] typeDeclarations1,
                                     java.lang.Object[] typeDeclarations2)

buildLiteralVisitor

protected LiteralVisitor buildLiteralVisitor()
Creates the visitor that can retrieve some information about various literal.

Specified by:
buildLiteralVisitor in class AbstractValidator
Returns:
A new LiteralVisitor

buildOwningClauseVisitor

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.

Specified by:
buildOwningClauseVisitor in class AbstractValidator
Returns:
A new AbstractValidator.OwningClauseVisitor

buildResultVariableInOrderByVisitor

protected DefaultSemanticValidator.ResultVariableInOrderByVisitor buildResultVariableInOrderByVisitor()

findAbstractSchemaName

protected AbstractSchemaName findAbstractSchemaName(UpdateItem expression)

getNullValueVisitor

protected DefaultSemanticValidator.NullValueVisitor getNullValueVisitor()

getType

protected java.lang.Object getType(Expression expression)

getTypeHelper

protected ITypeHelper getTypeHelper()

getUpdateClauseAbstractSchemaNameFinder

protected DefaultSemanticValidator.UpdateClauseAbstractSchemaNameFinder getUpdateClauseAbstractSchemaNameFinder()

getValidator

protected DefaultSemanticValidator.TypeValidator getValidator(java.lang.Class<? extends DefaultSemanticValidator.TypeValidator> validatorClass)

initialize

protected void initialize()
Initializes this validator.

Overrides:
initialize in class AbstractSemanticValidator

isBooleanType

protected boolean isBooleanType(Expression expression)
Determines whether the given Expression is of the correct type based on these rules:

Parameters:
expression - The Expression to validate
Returns:
true if the given Expression passes the checks; false otherwise

isComparisonEquivalentType

protected boolean isComparisonEquivalentType(Expression expression1,
                                             Expression expression2)

isEquivalentBetweenType

protected boolean isEquivalentBetweenType(Expression expression1,
                                          Expression expression2)

isIntegralType

protected boolean isIntegralType(Expression expression)
Determines whether the given Expression is of the correct type based on these rules:

Parameters:
expression - The Expression to validate
Returns:
true if the given Expression passes the checks; false otherwise

isNullValue

protected boolean isNullValue(Expression expression)

isNumericType

protected boolean isNumericType(Expression expression)
Determines whether the given Expression is of the correct type based on these rules:

Parameters:
expression - The Expression to validate
Returns:
true if the given Expression passes the checks; false otherwise

isStringType

protected boolean isStringType(Expression expression)
Determines whether the given Expression is of the correct type based on these rules:

Parameters:
expression - The Expression to validate
Returns:
true if the given Expression passes the checks; false otherwise

isValid

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.BooleanTypeValidator.

Parameters:
expression - The Expression to validate
validatorClass - The Java class of the DefaultSemanticValidator.BooleanTypeValidator that will determine if the given Expression has the right type
Returns:
true if the given Expression passes the checks; false otherwise

isValidWithFindQueryBNF

protected boolean isValidWithFindQueryBNF(AbstractExpression expression,
                                          java.lang.String queryBNF)

selectClausePathExpressionPathType

protected AbstractSemanticValidator.PathType selectClausePathExpressionPathType()
Returns the type of path expression that is allowed in the SELECT clause.

Specified by:
selectClausePathExpressionPathType in class AbstractSemanticValidator
Returns:
The type of path expressions allowed. The spec defines it as basic or object mapping only, i.e. collection-valued path expression is not allowed

validateAbsExpression

protected boolean validateAbsExpression(AbsExpression expression)
Validates the encapsulated expression of the given ABS expression. The test to perform is:

Overrides:
validateAbsExpression in class AbstractSemanticValidator
Parameters:
expression - The AbsExpression to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateArithmeticExpression

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. The test to perform is:

Overrides:
validateArithmeticExpression in class AbstractSemanticValidator
Parameters:
expression - The ArithmeticExpression to validate
leftExpressionWrongTypeMessageKey - The key used to describe the left expression does not have a valid type
rightExpressionWrongTypeMessageKey - The key used to describe the right expression does not have a valid type
Returns:
A number indicating the validation result. AbstractSemanticValidator.isValid(int, int) can be used to determine the validation status of an expression based on its position

validateAvgFunction

protected boolean validateAvgFunction(AvgFunction expression)
Validates the encapsulated expression of the given AVG expression. The test to perform is:

Overrides:
validateAvgFunction in class AbstractSemanticValidator
Parameters:
expression - The AvgFunction to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateBetweenExpression

protected int validateBetweenExpression(BetweenExpression expression)
Validates the given BetweenExpression. The test to perform is:

Overrides:
validateBetweenExpression in class AbstractSemanticValidator
Parameters:
expression - The BetweenExpression to validate

validateBooleanType

protected boolean validateBooleanType(Expression expression,
                                      java.lang.String messageKey)
Determines whether the given Expression is of the correct type based on these rules:

Parameters:
expression - The Expression to validate
messageKey - The key used to retrieve the localized message describing the problem

validateCollectionMemberExpression

protected int validateCollectionMemberExpression(CollectionMemberExpression expression)
Validates the given CollectionMemberExpression. Only the collection-valued path expression is validated.

Overrides:
validateCollectionMemberExpression in class AbstractSemanticValidator
Parameters:
expression - The CollectionMemberExpression to validate
Returns:
A number indicating the validation result. AbstractSemanticValidator.isValid(int, int) can be used to determine the validation status of an expression based on its position

validateComparisonExpression

protected boolean validateComparisonExpression(ComparisonExpression expression)
Validates the left and right expressions of the given ComparisonExpression. The tests to perform are:

Overrides:
validateComparisonExpression in class AbstractSemanticValidator
Parameters:
expression - The ConcatExpression to validate by validating its left and right expressions
Returns:
The status of the comparison between the left and right expression: true if the two expressions pass the rules defined by this method; false otherwise

validateConcatExpression

protected boolean validateConcatExpression(ConcatExpression expression)
Validates the encapsulated expression of the given CONCAT expression. The tests to perform are:

Overrides:
validateConcatExpression in class AbstractSemanticValidator
Parameters:
expression - The ConcatExpression to validate by validating its encapsulated expression
Returns:
false if the first encapsulated expression was validated and is invalid; true otherwise

validateConstructorExpression

protected void validateConstructorExpression(ConstructorExpression expression)
Validates the given ConstructorExpression. The default behavior does not require to semantically validate it.

Overrides:
validateConstructorExpression in class AbstractSemanticValidator
Parameters:
expression - The ConstructorExpression to validate

validateCountFunction

protected void validateCountFunction(CountFunction expression)
Validates the given CountFunction. The default behavior does not require to semantically validate it.

Overrides:
validateCountFunction in class AbstractSemanticValidator
Parameters:
expression - The CountFunction to validate

validateEntryExpression

protected void validateEntryExpression(EntryExpression expression)
Validates the given EntryExpression. The default behavior does not require to semantically validate it.

Overrides:
validateEntryExpression in class AbstractSemanticValidator
Parameters:
expression - The EntryExpression to validate

validateIdentificationVariable

protected boolean validateIdentificationVariable(IdentificationVariable expression,
                                                 java.lang.String variable)
Validates the given identification variable. The default behavior is to not validate it.

Overrides:
validateIdentificationVariable in class AbstractSemanticValidator
Parameters:
expression - The IdentificationVariable that is being visited
variable - The actual identification variable, which is never an empty string
Returns:
true if the given identification variable is valid; false otherwise

validateIntegralType

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:

Parameters:
expression - The Expression to validate
queryBNF - The unique identifier of the query BNF used to validate the type
messageKey - The key used to retrieve the localized message describing the problem
Returns:
false if the given expression was validated and is invalid; true otherwise

validateKeyExpression

protected void validateKeyExpression(KeyExpression expression)
Validates the given KeyExpression. The default behavior does not require to semantically validate it.

Overrides:
validateKeyExpression in class AbstractSemanticValidator
Parameters:
expression - The KeyExpression to validate

validateLengthExpression

protected boolean validateLengthExpression(LengthExpression expression)
Validates the encapsulated expression of the given LENGTH expression. The test to perform is:

Overrides:
validateLengthExpression in class AbstractSemanticValidator
Parameters:
expression - The LengthExpression to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateLocateExpression

protected int validateLocateExpression(LocateExpression expression)
Validates the encapsulated expression of the given LOCATE expression. The test to perform is:

Overrides:
validateLocateExpression in class AbstractSemanticValidator
Parameters:
expression - The LocateExpression to validate by validating its encapsulated expression
Returns:
A number indicating the validation result. AbstractSemanticValidator.isValid(int, int) can be used to determine the validation status of an expression based on its position

validateLowerExpression

protected boolean validateLowerExpression(LowerExpression expression)
Validates the encapsulated expression of the given LOWER expression. The test to perform is:

Overrides:
validateLowerExpression in class AbstractSemanticValidator
Parameters:
expression - The LowerExpression to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateMapIdentificationVariable

protected void validateMapIdentificationVariable(EncapsulatedIdentificationVariableExpression expression)

validateModExpression

protected int validateModExpression(ModExpression expression)
Validates the encapsulated expression of the given MOD expression. The test to perform is:

Overrides:
validateModExpression in class AbstractSemanticValidator
Parameters:
expression - The ModExpression to validate by validating its encapsulated expression
Returns:
A number indicating the validation result. AbstractSemanticValidator.isValid(int, int) can be used to determine the validation status of an expression based on its position

validateNotExpression

protected void validateNotExpression(NotExpression expression)
Validates the given NotExpression. The default behavior does not require to semantically validate it.

Overrides:
validateNotExpression in class AbstractSemanticValidator
Parameters:
expression - The NotExpression to validate

validateNullComparisonExpression

protected void validateNullComparisonExpression(NullComparisonExpression expression)
Validates the given NullComparisonExpression. The default behavior does not require to semantically validate it.

Overrides:
validateNullComparisonExpression in class AbstractSemanticValidator
Parameters:
expression - The NullComparisonExpression to validate

validateNumericType

protected boolean validateNumericType(Expression expression,
                                      java.lang.String messageKey)
Determines whether the given Expression is of the correct type based on these rules:

Parameters:
expression - The Expression to validate
messageKey - The key used to retrieve the localized message describing the problem
Returns:
false if the given expression was validated and is invalid; true otherwise

validateSqrtExpression

protected boolean validateSqrtExpression(SqrtExpression expression)
Validates the encapsulated expression of the given SQRT expression. The test to perform is:

Overrides:
validateSqrtExpression in class AbstractSemanticValidator
Parameters:
expression - The SqrtExpression to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateStringType

protected boolean validateStringType(Expression expression,
                                     java.lang.String messageKey)
Determines whether the given Expression is of the correct type based on these rules:

Parameters:
expression - The Expression to validate
messageKey - The key used to retrieve the localized message describing the problem
Returns:
false if the given expression was validated and is invalid; true otherwise

validateSubstringExpression

protected int validateSubstringExpression(SubstringExpression expression)
Validates the encapsulated expression of the given SUBSTRING expression. The test to perform is:

Overrides:
validateSubstringExpression in class AbstractSemanticValidator
Parameters:
expression - The SubstringExpression to validate by validating its encapsulated expression
Returns:
A number indicating the validation result. AbstractSemanticValidator.isValid(int, int) can be used to determine the validation status of an expression based on its position

validateSumFunction

protected boolean validateSumFunction(SumFunction expression)
Validates the encapsulated expression of the given MOD expression. The test to perform is:

Overrides:
validateSumFunction in class AbstractSemanticValidator
Parameters:
expression - The ModExpression to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateUpdateItem

protected boolean validateUpdateItem(UpdateItem expression)
Validates the given UpdateItem by validating the traversability of the path expression. The path expression is valid if it follows one of the following rules:

Overrides:
validateUpdateItem in class AbstractSemanticValidator
Parameters:
expression - UpdateItem to validate its path expression
Returns:
true if the path expression is valid; false otherwise

validateUpdateItemTypes

protected void validateUpdateItemTypes(UpdateItem expression,
                                       java.lang.Object type)

validateUpperExpression

protected boolean validateUpperExpression(UpperExpression expression)
Validates the encapsulated expression of the given UPPER expression. The test to perform is:

Overrides:
validateUpperExpression in class AbstractSemanticValidator
Parameters:
expression - The UpperExpression to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateValueExpression

protected void validateValueExpression(ValueExpression expression)
Validates the given ValueExpression. The default behavior does not require to semantically validate it.

Overrides:
validateValueExpression in class AbstractSemanticValidator
Parameters:
expression - The ValueExpression to validate

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference