Class AbstractContentAssistVisitor.GroupByClauseCollectionHelper
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.AbstractContentAssistVisitor.GroupByClauseCollectionHelper
- All Implemented Interfaces:
AbstractContentAssistVisitor.CollectionExpressionHelper<GroupByClause>
- Enclosing class:
AbstractContentAssistVisitor
protected static final class AbstractContentAssistVisitor.GroupByClauseCollectionHelper
extends Object
implements AbstractContentAssistVisitor.CollectionExpressionHelper<GroupByClause>
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AbstractContentAssistVisitor
Enclosing visitor instance. -
Constructor Summary
ModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAtTheEndOfChild
(GroupByClause expression, CollectionExpression collectionExpression, int index, boolean hasComma, boolean virtualSpace) Adds the proposals because the cursor is at the end of the child at the given position.void
addIdentifier
(GroupByClause expression, String identifier) Adds the given JPQL identifier as a valid proposal.void
addTheBeginningOfChild
(GroupByClause expression, CollectionExpression collectionExpression, int index, boolean hasComma) Adds the proposals because the cursor is at the beginning of the childExpression
at the given position.buildCollectionExpression
(GroupByClause expression) Either returns the givenExpression
's child, which is already aCollectionExpression
or requests this helper to return a "virtual"CollectionExpression
that is wrapping the single element.boolean
canContinue
(GroupByClause expression, CollectionExpression collectionExpression, int index) Asks this helper if the search can continue even though two child expressions are not separated by a comma.boolean
hasDelimiterAfterIdentifier
(GroupByClause expression) Determines whether a delimiter like a whitespace or an open parenthesis was parsed after the identifier.int
maxCollectionSize
(GroupByClause expression) Returns the maximum number of encapsulatedexpressions
theExpression
allows.int
preExpressionLength
(GroupByClause expression) Returns the length of anything that can be defined before the first child.queryBNF
(GroupByClause expression, int index) Returns theJPQLQueryBNF
that defines the fragment at the given position.
-
Field Details
-
visitor
Enclosing visitor instance.
-
-
Constructor Details
-
GroupByClauseCollectionHelper
-
-
Method Details
-
addAtTheEndOfChild
public void addAtTheEndOfChild(GroupByClause expression, CollectionExpression collectionExpression, int index, boolean hasComma, boolean virtualSpace) Description copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelper
Adds the proposals because the cursor is at the end of the child at the given position.- Specified by:
addAtTheEndOfChild
in interfaceAbstractContentAssistVisitor.CollectionExpressionHelper<GroupByClause>
- Parameters:
expression
- TheExpression
being visitedcollectionExpression
- TheCollectionExpression
is either the child of the givenExpression
or a temporary generated one that usually contains a single itemindex
- The position of that child in the collection of childrenhasComma
- Indicates whether a comma is present before the child at the given position; if the index is 0, then this isfalse
by defaultvirtualSpace
- Indicates if this method is called because the cursor is at the end of the child at the specified index but by considering there is a virtual space at the end of that child
-
addIdentifier
Description copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelper
Adds the given JPQL identifier as a valid proposal.- Specified by:
addIdentifier
in interfaceAbstractContentAssistVisitor.CollectionExpressionHelper<GroupByClause>
- Parameters:
expression
- TheExpression
being visitedidentifier
- The JPQL identifier to add as a valid proposal
-
addTheBeginningOfChild
public void addTheBeginningOfChild(GroupByClause expression, CollectionExpression collectionExpression, int index, boolean hasComma) Description copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelper
Adds the proposals because the cursor is at the beginning of the childExpression
at the given position.- Specified by:
addTheBeginningOfChild
in interfaceAbstractContentAssistVisitor.CollectionExpressionHelper<GroupByClause>
- Parameters:
expression
- TheExpression
being visitedcollectionExpression
- TheCollectionExpression
is either the child of the givenExpression
or a temporary generated one that usually contains a single item. This can be null if the position is at the beginningindex
- The position of the child that was scannedhasComma
- Indicates whether a comma is present before the child at the given position; if the index is 0, then this isfalse
by default
-
buildCollectionExpression
Description copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelper
Either returns the givenExpression
's child, which is already aCollectionExpression
or requests this helper to return a "virtual"CollectionExpression
that is wrapping the single element.- Specified by:
buildCollectionExpression
in interfaceAbstractContentAssistVisitor.CollectionExpressionHelper<GroupByClause>
- Parameters:
expression
- The parent of the children to retrieve- Returns:
- The given expression's child or a "virtual" one
-
canContinue
public boolean canContinue(GroupByClause expression, CollectionExpression collectionExpression, int index) Description copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelper
Asks this helper if the search can continue even though two child expressions are not separated by a comma.- Specified by:
canContinue
in interfaceAbstractContentAssistVisitor.CollectionExpressionHelper<GroupByClause>
- Parameters:
expression
- TheExpression
being visitedcollectionExpression
- TheCollectionExpression
index
- The position of the child being scanned- Returns:
true
if the check can continue even though the previous child was not separated by a comma;false
to stop the check
-
hasDelimiterAfterIdentifier
Description copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelper
Determines whether a delimiter like a whitespace or an open parenthesis was parsed after the identifier.- Specified by:
hasDelimiterAfterIdentifier
in interfaceAbstractContentAssistVisitor.CollectionExpressionHelper<GroupByClause>
- Parameters:
expression
- TheExpression
being visited- Returns:
true
if something is present;false
otherwise
-
maxCollectionSize
Description copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelper
Returns the maximum number of encapsulatedexpressions
theExpression
allows. Some expression only allow 2, others 3 and others allow an unlimited number.- Specified by:
maxCollectionSize
in interfaceAbstractContentAssistVisitor.CollectionExpressionHelper<GroupByClause>
- Parameters:
expression
- TheExpression
for which its maximum number of children- Returns:
- The maximum number of children the expression can have
-
preExpressionLength
Description copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelper
Returns the length of anything that can be defined before the first child. An example can be "DISTINCT
" in "AVG(DISTINCT e.name)
".- Specified by:
preExpressionLength
in interfaceAbstractContentAssistVisitor.CollectionExpressionHelper<GroupByClause>
- Parameters:
expression
- TheExpression
being visited- Returns:
- The length of anything that was parsed before the first child or 0 if nothing was parsed
-
queryBNF
Description copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelper
Returns theJPQLQueryBNF
that defines the fragment at the given position.- Specified by:
queryBNF
in interfaceAbstractContentAssistVisitor.CollectionExpressionHelper<GroupByClause>
- Parameters:
expression
- TheExpression
being visitedindex
- The position of the element to retrieve the BNF defined in the JPQL grammar- Returns:
- The
JPQLQueryBNF
that defines the fragment at the given position
-