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 theGROUP BY
clause.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
clause
The clause being visited, which is marked by its JPQL identifier.protected boolean
complete
Determines whether anExpression
that was visited is complete or if some part is missing.protected boolean
insideCollection
This flag is used to make sure only the last expression in a collection is tested.
-
Constructor Summary
Constructors Modifier Constructor Description protected
IncompleteCollectionExpressionVisitor()
-
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.void
dispose()
Disposes of the internal data.boolean
isComplete()
Determines whether anExpression
that was visited is complete or if some part is missing.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.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
-
-
-
-
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 anExpression
that 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 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
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 theCollectionExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(FromClause expression)
Visits theFromClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(GroupByClause expression)
Visits theGroupByClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(HavingClause expression)
Visits theHavingClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(IdentificationVariable expression)
Visits theIdentificationVariable
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(IdentificationVariableDeclaration expression)
Visits theIdentificationVariableDeclaration
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(OrderByClause expression)
Visits theOrderByClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(RangeVariableDeclaration expression)
Visits theRangeVariableDeclaration
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(WhereClause expression)
Visits theWhereClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAbstractExpressionVisitor
- Parameters:
expression
- TheWhereClause
to visit
-
-