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
public static class AbstractValidator.JPQLQueryBNFValidator extends AnonymousExpressionVisitor
This visitor validates anyExpression
by checking its BNF against some BNFs.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
bypassCompound
protected boolean
valid
Determines whether the visitedExpression
's BNF is valid based on the BNF that was used for validation.
-
Constructor Summary
Constructors Constructor Description JPQLQueryBNFValidator(JPQLQueryBNF queryBNF)
Creates a newJPQLQueryBNFValidator
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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)
Setsvoid
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
-
-
-
-
Field Detail
-
bypassCompound
protected boolean bypassCompound
-
valid
protected boolean valid
Determines whether the visitedExpression
's BNF is valid based on the BNF that was used for validation.
-
-
Constructor Detail
-
JPQLQueryBNFValidator
public JPQLQueryBNFValidator(JPQLQueryBNF queryBNF)
Creates a newJPQLQueryBNFValidator
.- Parameters:
queryBNF
- TheJPQLQueryBNF
used to determine if the expression's BNF is valid
-
-
Method Detail
-
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- Parameters:
bypassCompound
-
-
validate
public void 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.- Parameters:
queryBNF
- TheJPQLQueryBNF
to validate
-
visit
public void visit(BadExpression expression)
Visits theBadExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(CollectionExpression expression)
Visits theCollectionExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
protected void visit(Expression expression)
Blindly visit the givenExpression
.- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(NullExpression expression)
Visits theNullExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(SubExpression expression)
Visits theSubExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(UnknownExpression expression)
Visits theUnknownExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheUnknownExpression
to visit
-
-