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
FieldsModifier and TypeFieldDescriptionprotected StringThe clause being visited, which is marked by its JPQL identifier.protected booleanDetermines whether anExpressionthat was visited is complete or if some part is missing.protected booleanThis flag is used to make sure only the last expression in a collection is tested. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompositeIdentifiersAfter(String afterIdentifier) Returns the list of identifiers for the clauses following the given identifier.voiddispose()Disposes of the internal data.booleanDetermines whether anExpressionthat was visited is complete or if some part is missing.protected booleanisPossibleCompositeIdentifier(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.voidvisit(CollectionExpression expression) Visits theCollectionExpressionexpression.voidvisit(FromClause expression) Visits theFromClauseexpression.voidvisit(GroupByClause expression) Visits theGroupByClauseexpression.voidvisit(HavingClause expression) Visits theHavingClauseexpression.voidvisit(IdentificationVariable expression) Visits theIdentificationVariableexpression.voidvisit(IdentificationVariableDeclaration expression) Visits theIdentificationVariableDeclarationexpression.voidvisit(OrderByClause expression) Visits theOrderByClauseexpression.voidvisit(RangeVariableDeclaration expression) Visits theRangeVariableDeclarationexpression.voidvisit(WhereClause expression) Visits theWhereClauseexpression.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 anExpressionthat 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 anExpressionthat was visited is complete or if some part is missing.- Returns:
trueif the visitedExpressionis grammatically complete;falseif 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:ExpressionVisitorVisits theCollectionExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
Description copied from interface:ExpressionVisitorVisits theFromClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
Description copied from interface:ExpressionVisitorVisits theGroupByClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
Description copied from interface:ExpressionVisitorVisits theHavingClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
Description copied from interface:ExpressionVisitorVisits theIdentificationVariableexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
Description copied from interface:ExpressionVisitorVisits theIdentificationVariableDeclarationexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
Description copied from interface:ExpressionVisitorVisits theOrderByClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
Description copied from interface:ExpressionVisitorVisits theRangeVariableDeclarationexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
Description copied from interface:ExpressionVisitorVisits theWhereClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheWhereClauseto visit
-