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 BIn this example, the
FROMclause 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 theGROUP BYclause.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringclauseThe clause being visited, which is marked by its JPQL identifier.protected booleancompleteDetermines whether anExpressionthat was visited is complete or if some part is missing.protected booleaninsideCollectionThis flag is used to make sure only the last expression in a collection is tested.
-
Constructor Summary
Constructors Modifier Constructor Description protectedIncompleteCollectionExpressionVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<java.lang.String>compositeIdentifiersAfter(java.lang.String afterIdentifier)Returns the list of identifiers for the clauses following the given identifier.voiddispose()Disposes of the internal data.booleanisComplete()Determines whether anExpressionthat was visited is complete or if some part is missing.protected booleanisPossibleCompositeIdentifier(java.lang.String clause, java.lang.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
-
-
-
-
Field Detail
-
clause
protected java.lang.String clause
The clause being visited, which is marked by its JPQL identifier.
-
complete
protected boolean complete
Determines whether anExpressionthat was visited is complete or if some part is missing.
-
insideCollection
protected boolean insideCollection
This 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".
-
-
Method Detail
-
compositeIdentifiersAfter
protected java.util.List<java.lang.String> compositeIdentifiersAfter(java.lang.String afterIdentifier)
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
protected boolean isPossibleCompositeIdentifier(java.lang.String clause, java.lang.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.- 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
public void visit(CollectionExpression expression)
Visits theCollectionExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(FromClause expression)
Visits theFromClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(GroupByClause expression)
Visits theGroupByClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(HavingClause expression)
Visits theHavingClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(IdentificationVariable expression)
Visits theIdentificationVariableexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(IdentificationVariableDeclaration expression)
Visits theIdentificationVariableDeclarationexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(OrderByClause expression)
Visits theOrderByClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(RangeVariableDeclaration expression)
Visits theRangeVariableDeclarationexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(WhereClause expression)
Visits theWhereClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAbstractExpressionVisitor- Parameters:
expression- TheWhereClauseto visit
-
-