protected static final class AbstractContentAssistVisitor.TripleEncapsulatedCollectionHelper extends java.lang.Object implements AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractTripleEncapsulatedExpression>
Modifier | Constructor and Description |
---|---|
protected |
TripleEncapsulatedCollectionHelper(AbstractContentAssistVisitor visitor) |
Modifier and Type | Method and Description |
---|---|
void |
addAtTheEndOfChild(AbstractTripleEncapsulatedExpression 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(AbstractTripleEncapsulatedExpression expression,
java.lang.String identifier)
Adds the given JPQL identifier as a valid proposal.
|
void |
addTheBeginningOfChild(AbstractTripleEncapsulatedExpression expression,
CollectionExpression collectionExpression,
int index,
boolean hasComma)
Adds the proposals because the cursor is at the beginning of the child
Expression
at the given position. |
CollectionExpression |
buildCollectionExpression(AbstractTripleEncapsulatedExpression expression)
Either returns the given
Expression 's child, which is already a CollectionExpression
or requests this helper to return a "virtual" CollectionExpression that is wrapping
the single element. |
boolean |
canContinue(AbstractTripleEncapsulatedExpression 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(AbstractTripleEncapsulatedExpression expression)
Determines whether a delimiter like a whitespace or an open parenthesis was parsed after
the identifier.
|
int |
maxCollectionSize(AbstractTripleEncapsulatedExpression expression)
Returns the maximum number of encapsulated
expressions the Expression
allows. |
int |
preExpressionLength(AbstractTripleEncapsulatedExpression expression)
Returns the length of anything that can be defined before the first child.
|
JPQLQueryBNF |
queryBNF(AbstractTripleEncapsulatedExpression expression,
int index)
Returns the
JPQLQueryBNF that defines the fragment at the given position. |
protected TripleEncapsulatedCollectionHelper(AbstractContentAssistVisitor visitor)
public void addAtTheEndOfChild(AbstractTripleEncapsulatedExpression expression, CollectionExpression collectionExpression, int index, boolean hasComma, boolean virtualSpace)
addAtTheEndOfChild
in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractTripleEncapsulatedExpression>
expression
- The Expression
being visitedcollectionExpression
- The CollectionExpression
is either the child of the
given Expression
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 is false
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 childpublic void addIdentifier(AbstractTripleEncapsulatedExpression expression, java.lang.String identifier)
addIdentifier
in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractTripleEncapsulatedExpression>
expression
- The Expression
being visitedidentifier
- The JPQL identifier to add as a valid proposalpublic void addTheBeginningOfChild(AbstractTripleEncapsulatedExpression expression, CollectionExpression collectionExpression, int index, boolean hasComma)
Expression
at the given position.addTheBeginningOfChild
in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractTripleEncapsulatedExpression>
expression
- The Expression
being visitedcollectionExpression
- The CollectionExpression
is either the child of the
given Expression
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 is false
by defaultpublic CollectionExpression buildCollectionExpression(AbstractTripleEncapsulatedExpression expression)
Expression
's child, which is already a CollectionExpression
or requests this helper to return a "virtual" CollectionExpression
that is wrapping
the single element.buildCollectionExpression
in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractTripleEncapsulatedExpression>
expression
- The parent of the children to retrievepublic boolean canContinue(AbstractTripleEncapsulatedExpression expression, CollectionExpression collectionExpression, int index)
canContinue
in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractTripleEncapsulatedExpression>
expression
- The Expression
being visitedcollectionExpression
- The CollectionExpression
index
- The position of the child being scannedtrue
if the check can continue even though the previous child was not
separated by a comma; false
to stop the checkpublic boolean hasDelimiterAfterIdentifier(AbstractTripleEncapsulatedExpression expression)
hasDelimiterAfterIdentifier
in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractTripleEncapsulatedExpression>
expression
- The Expression
being visitedtrue
if something is present; false
otherwisepublic int maxCollectionSize(AbstractTripleEncapsulatedExpression expression)
expressions
the Expression
allows. Some expression only allow 2, others 3 and others allow an unlimited number.maxCollectionSize
in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractTripleEncapsulatedExpression>
expression
- The Expression
for which its maximum number of childrenpublic int preExpressionLength(AbstractTripleEncapsulatedExpression expression)
DISTINCT
" in "AVG(DISTINCT e.name)
".preExpressionLength
in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractTripleEncapsulatedExpression>
expression
- The Expression
being visitedpublic JPQLQueryBNF queryBNF(AbstractTripleEncapsulatedExpression expression, int index)
JPQLQueryBNF
that defines the fragment at the given position.queryBNF
in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractTripleEncapsulatedExpression>
expression
- The Expression
being visitedindex
- The position of the element to retrieve the BNF defined in the JPQL grammarJPQLQueryBNF
that defines the fragment at the given position