Class AbstractContentAssistVisitor.ConcatExpressionCollectionHelper
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.AbstractContentAssistVisitor.ConcatExpressionCollectionHelper
- All Implemented Interfaces:
- AbstractContentAssistVisitor.CollectionExpressionHelper<ConcatExpression>
- Enclosing class:
- AbstractContentAssistVisitor
protected static final class AbstractContentAssistVisitor.ConcatExpressionCollectionHelper
extends Object
implements AbstractContentAssistVisitor.CollectionExpressionHelper<ConcatExpression>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final AbstractContentAssistVisitorEnclosing visitor instance.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotected
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddAtTheEndOfChild(ConcatExpression 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.voidaddIdentifier(ConcatExpression expression, String identifier) Adds the given JPQL identifier as a valid proposal.voidaddTheBeginningOfChild(ConcatExpression expression, CollectionExpression collectionExpression, int index, boolean hasComma) Adds the proposals because the cursor is at the beginning of the childExpressionat the given position.buildCollectionExpression(ConcatExpression expression) Either returns the givenExpression's child, which is already aCollectionExpressionor requests this helper to return a "virtual"CollectionExpressionthat is wrapping the single element.booleancanContinue(ConcatExpression expression, CollectionExpression collectionExpression, int index) Asks this helper if the search can continue even though two child expressions are not separated by a comma.booleanhasDelimiterAfterIdentifier(ConcatExpression expression) Determines whether a delimiter like a whitespace or an open parenthesis was parsed after the identifier.intmaxCollectionSize(ConcatExpression expression) Returns the maximum number of encapsulatedexpressionstheExpressionallows.intpreExpressionLength(ConcatExpression expression) Returns the length of anything that can be defined before the first child.queryBNF(ConcatExpression expression, int index) Returns theJPQLQueryBNFthat defines the fragment at the given position.
- 
Field Details- 
visitorEnclosing visitor instance.
 
- 
- 
Constructor Details- 
ConcatExpressionCollectionHelper
 
- 
- 
Method Details- 
addAtTheEndOfChildpublic void addAtTheEndOfChild(ConcatExpression expression, CollectionExpression collectionExpression, int index, boolean hasComma, boolean virtualSpace) Description copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelperAdds the proposals because the cursor is at the end of the child at the given position.- Specified by:
- addAtTheEndOfChildin interface- AbstractContentAssistVisitor.CollectionExpressionHelper<ConcatExpression>
- Parameters:
- expression- The- Expressionbeing visited
- collectionExpression- The- CollectionExpressionis either the child of the given- Expressionor a temporary generated one that usually contains a single item
- index- The position of that child in the collection of children
- hasComma- Indicates whether a comma is present before the child at the given position; if the index is 0, then this is- falseby default
- virtualSpace- 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
 
- 
addIdentifierDescription copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelperAdds the given JPQL identifier as a valid proposal.- Specified by:
- addIdentifierin interface- AbstractContentAssistVisitor.CollectionExpressionHelper<ConcatExpression>
- Parameters:
- expression- The- Expressionbeing visited
- identifier- The JPQL identifier to add as a valid proposal
 
- 
addTheBeginningOfChildpublic void addTheBeginningOfChild(ConcatExpression expression, CollectionExpression collectionExpression, int index, boolean hasComma) Description copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelperAdds the proposals because the cursor is at the beginning of the childExpressionat the given position.- Specified by:
- addTheBeginningOfChildin interface- AbstractContentAssistVisitor.CollectionExpressionHelper<ConcatExpression>
- Parameters:
- expression- The- Expressionbeing visited
- collectionExpression- The- CollectionExpressionis either the child of the given- Expressionor a temporary generated one that usually contains a single item. This can be null if the position is at the beginning
- index- The position of the child that was scanned
- hasComma- Indicates whether a comma is present before the child at the given position; if the index is 0, then this is- falseby default
 
- 
buildCollectionExpressionDescription copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelperEither returns the givenExpression's child, which is already aCollectionExpressionor requests this helper to return a "virtual"CollectionExpressionthat is wrapping the single element.- Specified by:
- buildCollectionExpressionin interface- AbstractContentAssistVisitor.CollectionExpressionHelper<ConcatExpression>
- Parameters:
- expression- The parent of the children to retrieve
- Returns:
- The given expression's child or a "virtual" one
 
- 
canContinuepublic boolean canContinue(ConcatExpression expression, CollectionExpression collectionExpression, int index) Description copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelperAsks this helper if the search can continue even though two child expressions are not separated by a comma.- Specified by:
- canContinuein interface- AbstractContentAssistVisitor.CollectionExpressionHelper<ConcatExpression>
- Parameters:
- expression- The- Expressionbeing visited
- collectionExpression- The- CollectionExpression
- index- The position of the child being scanned
- Returns:
- trueif the check can continue even though the previous child was not separated by a comma;- falseto stop the check
 
- 
hasDelimiterAfterIdentifierDescription copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelperDetermines whether a delimiter like a whitespace or an open parenthesis was parsed after the identifier.- Specified by:
- hasDelimiterAfterIdentifierin interface- AbstractContentAssistVisitor.CollectionExpressionHelper<ConcatExpression>
- Parameters:
- expression- The- Expressionbeing visited
- Returns:
- trueif something is present;- falseotherwise
 
- 
maxCollectionSizeDescription copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelperReturns the maximum number of encapsulatedexpressionstheExpressionallows. Some expression only allow 2, others 3 and others allow an unlimited number.- Specified by:
- maxCollectionSizein interface- AbstractContentAssistVisitor.CollectionExpressionHelper<ConcatExpression>
- Parameters:
- expression- The- Expressionfor which its maximum number of children
- Returns:
- The maximum number of children the expression can have
 
- 
preExpressionLengthDescription copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelperReturns the length of anything that can be defined before the first child. An example can be "DISTINCT" in "AVG(DISTINCT e.name)".- Specified by:
- preExpressionLengthin interface- AbstractContentAssistVisitor.CollectionExpressionHelper<ConcatExpression>
- Parameters:
- expression- The- Expressionbeing visited
- Returns:
- The length of anything that was parsed before the first child or 0 if nothing was parsed
 
- 
queryBNFDescription copied from interface:AbstractContentAssistVisitor.CollectionExpressionHelperReturns theJPQLQueryBNFthat defines the fragment at the given position.- Specified by:
- queryBNFin interface- AbstractContentAssistVisitor.CollectionExpressionHelper<ConcatExpression>
- Parameters:
- expression- The- Expressionbeing visited
- index- The position of the element to retrieve the BNF defined in the JPQL grammar
- Returns:
- The JPQLQueryBNFthat defines the fragment at the given position
 
 
-