Package org.eclipse.persistence.jpa.jpql
Class AbstractValidator.JPQLQueryBNFValidator
java.lang.Object
org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
org.eclipse.persistence.jpa.jpql.AbstractValidator.JPQLQueryBNFValidator
- All Implemented Interfaces:
ExpressionVisitor
- Enclosing class:
AbstractValidator
This visitor validates any
Expression
by checking its BNF against some BNFs.-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
Determines whether the visitedExpression
's BNF is valid based on the BNF that was used for validation. -
Constructor Summary
ConstructorDescriptionJPQLQueryBNFValidator
(JPQLQueryBNF queryBNF) Creates a newJPQLQueryBNFValidator
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes of the internal data.boolean
isValid()
Determines whether the visitedExpression
is valid or not based on theJPQLQueryBNF
that was specified.void
setBypassCompound
(boolean bypassCompound) Sets bypassCompoundvoid
validate
(JPQLQueryBNF queryBNF) Validates the givenJPQLQueryBNF
by making sure it is the one expected or one of the children from the "root" BNF passed to this validator's constructor.void
visit
(BadExpression expression) Visits theBadExpression
expression.void
visit
(CollectionExpression expression) Visits theCollectionExpression
expression.protected void
visit
(Expression expression) Blindly visit the givenExpression
.void
visit
(NullExpression expression) Visits theNullExpression
expression.void
visit
(SubExpression expression) Visits theSubExpression
expression.void
visit
(UnknownExpression expression) Visits theUnknownExpression
expression.Methods inherited from class org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
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, visit, visit, visit, visit
-
Field Details
-
bypassCompound
protected boolean bypassCompound -
valid
protected boolean validDetermines whether the visitedExpression
's BNF is valid based on the BNF that was used for validation.
-
-
Constructor Details
-
JPQLQueryBNFValidator
Creates a newJPQLQueryBNFValidator
.- Parameters:
queryBNF
- TheJPQLQueryBNF
used to determine if the expression's BNF is valid
-
-
Method Details
-
dispose
public void dispose()Disposes of the internal data. -
isValid
public boolean isValid()Determines whether the visitedExpression
is valid or not based on theJPQLQueryBNF
that was specified.- Returns:
true
if theExpression
is valid;false
otherwise
-
setBypassCompound
public void setBypassCompound(boolean bypassCompound) Sets bypassCompound- Parameters:
bypassCompound
- Indicates whether aJPQLQueryBNF
representing a compound expression should be considered when doing the validation
-
validate
Validates the givenJPQLQueryBNF
by making sure it is the one expected or one of the children from the "root" BNF passed to this validator's constructor.- Parameters:
queryBNF
- TheJPQLQueryBNF
to validate
-
visit
Description copied from interface:ExpressionVisitor
Visits theBadExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theCollectionExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from class:AnonymousExpressionVisitor
Blindly visit the givenExpression
.- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theNullExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theSubExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theUnknownExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheUnknownExpression
to visit
-