Class AbstractContentAssistVisitor.EnumVisitor
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.parser.AbstractExpressionVisitor
-
- org.eclipse.persistence.jpa.jpql.tools.AbstractContentAssistVisitor.EnumVisitor
-
- All Implemented Interfaces:
ExpressionVisitor
- Enclosing class:
- AbstractContentAssistVisitor
protected static final class AbstractContentAssistVisitor.EnumVisitor extends AbstractExpressionVisitor
This visitor determines whether a path expression can be resolved as a fully qualified enum type and an enum constant.The valid locations are:
CollectionMemberExpression
: entity_or_value_expression (beforeMEMBER
identifier);InExpression
: One of the items;CaseExpression
: TheELSE expression
;WhenClause
: TheWHEN
orTHEN
expressions;FunctionExpression
: One of the function items;ComparisonExpression
: The left or right expression if the comparison identifier is either=
or<>
;UpdateItem
: The new value;ConstructorExpression
: One of the constructor items;CoalesceExpression
: The expression at index 1 or greater;NullIfExpression
: The second expression;
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractPathExpression
pathExpression
TheAbstractPathExpression
being scanned for its location within the JPQL query.protected boolean
valid
Determines whether the path expression could potentially represent a fully qualified enum constant, which is dictated by the location of the path expression within the query.
-
Constructor Summary
Constructors Modifier Constructor Description protected
EnumVisitor()
-
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 path expression could potentially represent a fully qualified enum constant, which is dictated by the location of the path expression within the query.void
visit(CaseExpression expression)
Visits theCaseExpression
expression.void
visit(CoalesceExpression expression)
Visits theCoalesceExpression
expression.void
visit(CollectionMemberExpression expression)
Visits theCollectionMemberExpression
expression.void
visit(CollectionValuedPathExpression expression)
Visits theCollectionValuedPathExpression
expression.void
visit(ComparisonExpression expression)
Visits theComparisonExpression
expression.void
visit(ConstructorExpression expression)
Visits theConstructorExpression
expression.void
visit(FunctionExpression expression)
Visits theFunctionExpression
expression.void
visit(InExpression expression)
Visits theInExpression
expression.void
visit(NullIfExpression expression)
Visits theNullIfExpression
expression.void
visit(StateFieldPathExpression expression)
Visits theStateFieldPathExpression
expression.void
visit(UpdateItem expression)
Visits theUpdateItem
expression.void
visit(WhenClause expression)
Visits theWhenClause
expression.-
Methods inherited from class org.eclipse.persistence.jpa.jpql.parser.AbstractExpressionVisitor
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
-
pathExpression
protected AbstractPathExpression pathExpression
TheAbstractPathExpression
being scanned for its location within the JPQL query.
-
valid
protected boolean valid
Determines whether the path expression could potentially represent a fully qualified enum constant, which is dictated by the location of the path expression within the query. Only a few location allows an enum constant.
-
-
Method Detail
-
dispose
public void dispose()
Disposes of the internal data.
-
isValid
public boolean isValid()
Determines whether the path expression could potentially represent a fully qualified enum constant, which is dictated by the location of the path expression within the query. Only a few location allows an enum constant.- Returns:
true
if the path expression represents a enum constant;false
otherwise
-
visit
public void visit(CaseExpression expression)
Visits theCaseExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(CoalesceExpression expression)
Visits theCoalesceExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(CollectionMemberExpression expression)
Visits theCollectionMemberExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(CollectionValuedPathExpression expression)
Visits theCollectionValuedPathExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(ComparisonExpression expression)
Visits theComparisonExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(ConstructorExpression expression)
Visits theConstructorExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(FunctionExpression expression)
Visits theFunctionExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(InExpression expression)
Visits theInExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(NullIfExpression expression)
Visits theNullIfExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(StateFieldPathExpression expression)
Visits theStateFieldPathExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(UpdateItem expression)
Visits theUpdateItem
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheUpdateItem
to visit
-
visit
public void visit(WhenClause expression)
Visits theWhenClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheWhenClause
to visit
-
-