Class AbstractContentAssistVisitor.IncompleteCollectionExpressionVisitor
java.lang.Object
org.eclipse.persistence.jpa.jpql.parser.AbstractExpressionVisitor
org.eclipse.persistence.jpa.jpql.tools.AbstractContentAssistVisitor.IncompleteCollectionExpressionVisitor
- All Implemented Interfaces:
ExpressionVisitor
- Direct Known Subclasses:
EclipseLinkContentAssistVisitor.IncompleteCollectionExpressionVisitor
- Enclosing class:
AbstractContentAssistVisitor
protected static class AbstractContentAssistVisitor.IncompleteCollectionExpressionVisitor
extends AbstractExpressionVisitor
This visitor is used when a clause or a compound expression was parsed with a collection of
expressions representing an invalid fragment.
Example: SELECT e FROM Employee e GROUP B
In this example, the FROM
clause contains a collection of two
identification variable declarations, in a valid query, it would be separated by a comma, but
this one just means it's incomplete and "GROUP B" is the beginning of the GROUP BY
clause.
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
The clause being visited, which is marked by its JPQL identifier.protected boolean
Determines whether anExpression
that was visited is complete or if some part is missing.protected boolean
This flag is used to make sure only the last expression in a collection is tested. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncompositeIdentifiersAfter
(String afterIdentifier) Returns the list of identifiers for the clauses following the given identifier.void
dispose()
Disposes of the internal data.boolean
Determines whether anExpression
that was visited is complete or if some part is missing.protected boolean
isPossibleCompositeIdentifier
(String clause, String fragment) Determines whether the given JPQL fragment, which is the parsed text of the expression invalid collection expression or the portion of it based on the cursor position within the collection, is a composite identifier or not.void
visit
(CollectionExpression expression) Visits theCollectionExpression
expression.void
visit
(FromClause expression) Visits theFromClause
expression.void
visit
(GroupByClause expression) Visits theGroupByClause
expression.void
visit
(HavingClause expression) Visits theHavingClause
expression.void
visit
(IdentificationVariable expression) Visits theIdentificationVariable
expression.void
visit
(IdentificationVariableDeclaration expression) Visits theIdentificationVariableDeclaration
expression.void
visit
(OrderByClause expression) Visits theOrderByClause
expression.void
visit
(RangeVariableDeclaration expression) Visits theRangeVariableDeclaration
expression.void
visit
(WhereClause expression) Visits theWhereClause
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, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Field Details
-
clause
The clause being visited, which is marked by its JPQL identifier. -
complete
protected boolean completeDetermines whether anExpression
that was visited is complete or if some part is missing. -
insideCollection
protected boolean insideCollectionThis flag is used to make sure only the last expression in a collection is tested. A single expression cannot be used to check the "completeness".
-
-
Constructor Details
-
IncompleteCollectionExpressionVisitor
protected IncompleteCollectionExpressionVisitor()
-
-
Method Details
-
compositeIdentifiersAfter
Returns the list of identifiers for the clauses following the given identifier.- Parameters:
afterIdentifier
- The JPQL identifier of the clause for which the list of following clauses is built- Returns:
- The list of JPQL identifiers defining the clauses following the clause specified by the given identifier
-
dispose
public void dispose()Disposes of the internal data. -
isComplete
public boolean isComplete()Determines whether anExpression
that was visited is complete or if some part is missing.- Returns:
true
if the visitedExpression
is grammatically complete;false
if it is incomplete
-
isPossibleCompositeIdentifier
Determines whether the given JPQL fragment, which is the parsed text of the expression invalid collection expression or the portion of it based on the cursor position within the collection, is a composite identifier or not.- Parameters:
clause
- The JPQL identifier of the clause having the collection of expressionsfragment
- The parsed text of the expression to determine if it's the beginning of the composite identifier or not. The fragment is all lower case characters
-
visit
Description copied from interface:ExpressionVisitor
Visits theCollectionExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theFromClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theGroupByClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theHavingClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theIdentificationVariable
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theIdentificationVariableDeclaration
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theOrderByClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theRangeVariableDeclaration
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theWhereClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheWhereClause
to visit
-