EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.jpa.jpql
Class AbstractContentAssistVisitor.AbstractConditionalClauseCollectionHelper

java.lang.Object
  extended by org.eclipse.persistence.jpa.jpql.AbstractContentAssistVisitor.AbstractConditionalClauseCollectionHelper
All Implemented Interfaces:
AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractConditionalClause>
Enclosing class:
AbstractContentAssistVisitor

protected class AbstractContentAssistVisitor.AbstractConditionalClauseCollectionHelper
extends java.lang.Object
implements AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractConditionalClause>


Constructor Summary
protected AbstractContentAssistVisitor.AbstractConditionalClauseCollectionHelper()
           
 
Method Summary
 void addAtTheEndOfChild(AbstractConditionalClause 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(AbstractConditionalClause expression, java.lang.String identifier)
          Adds the given JPQL identifier as a valid proposal.
 void addTheBeginningOfChild(AbstractConditionalClause 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(AbstractConditionalClause 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(AbstractConditionalClause expression, CollectionExpression collectionExpression, int index)
          Asks this helper if the search can continue even though two child expressions are not separated by a comma.
protected  java.lang.Object[] findChild(CollectionExpression collectionExpression, int index)
          Handles a special case for a compound identifier like 'IS EMPTY' or 'IS NOT EMPTY'.
 boolean hasDelimiterAfterIdentifier(AbstractConditionalClause expression)
          Determines whether a delimiter like a whitespace or an open parenthesis was parsed after the identifier.
 int maxCollectionSize(AbstractConditionalClause expression)
          Returns the maximum number of encapsulated expressions the Expression allows.
 int preExpressionLength(AbstractConditionalClause expression)
          Returns the length of anything that can be defined before the first child.
 JPQLQueryBNF queryBNF(AbstractConditionalClause expression, int index)
          Returns the JPQLQueryBNF that defines the fragment at the given position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractContentAssistVisitor.AbstractConditionalClauseCollectionHelper

protected AbstractContentAssistVisitor.AbstractConditionalClauseCollectionHelper()
Method Detail

addAtTheEndOfChild

public void addAtTheEndOfChild(AbstractConditionalClause 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.

Specified by:
addAtTheEndOfChild in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractConditionalClause>
Parameters:
expression - The Expression being visited
collectionExpression - The CollectionExpression is either the child of the given Expression or 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 false by 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

addIdentifier

public void addIdentifier(AbstractConditionalClause expression,
                          java.lang.String identifier)
Adds the given JPQL identifier as a valid proposal.

Specified by:
addIdentifier in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractConditionalClause>
Parameters:
expression - The Expression being visited
identifier - The JPQL identifier to add as a valid proposal

addTheBeginningOfChild

public void addTheBeginningOfChild(AbstractConditionalClause 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.

Specified by:
addTheBeginningOfChild in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractConditionalClause>
Parameters:
expression - The Expression being visited
collectionExpression - 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 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 false by default

buildCollectionExpression

public CollectionExpression buildCollectionExpression(AbstractConditionalClause 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.

Specified by:
buildCollectionExpression in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractConditionalClause>
Parameters:
expression - The parent of the children to retrieve
Returns:
The given expression's child or a "virtual" one

canContinue

public boolean canContinue(AbstractConditionalClause expression,
                           CollectionExpression collectionExpression,
                           int index)
Asks this helper if the search can continue even though two child expressions are not separated by a comma.

Specified by:
canContinue in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractConditionalClause>
Parameters:
expression - The Expression being visited
collectionExpression - The CollectionExpression
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

findChild

protected java.lang.Object[] findChild(CollectionExpression collectionExpression,
                                       int index)
Handles a special case for a compound identifier like 'IS EMPTY' or 'IS NOT EMPTY'.

Parameters:
collectionExpression - The CollectionExpression is used to find the Expression to use when filtering out compound identifier
index - The position to start the search, which goes from that index to the beginning
Returns:
An array of three elements. The first one is the child Expression that can be used when filtering out compound identifier. The second boolean element indicates if IS was detected after the child. The third boolean element indicates if NOT was detected after the child, which would also be after IS if it was detected. null is returned if nothing could be found

hasDelimiterAfterIdentifier

public boolean hasDelimiterAfterIdentifier(AbstractConditionalClause expression)
Determines whether a delimiter like a whitespace or an open parenthesis was parsed after the identifier.

Specified by:
hasDelimiterAfterIdentifier in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractConditionalClause>
Parameters:
expression - The Expression being visited
Returns:
true if something is present; false otherwise

maxCollectionSize

public int maxCollectionSize(AbstractConditionalClause expression)
Returns the maximum number of encapsulated expressions the Expression allows. Some expression only allow 2, others 3 and others allow an unlimited number.

Specified by:
maxCollectionSize in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractConditionalClause>
Parameters:
expression - The Expression for which its maximum number of children
Returns:
The maximum number of children the expression can have

preExpressionLength

public int preExpressionLength(AbstractConditionalClause expression)
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 interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractConditionalClause>
Parameters:
expression - The Expression being visited
Returns:
The length of anything that was parsed before the first child or 0 if nothing was parsed

queryBNF

public JPQLQueryBNF queryBNF(AbstractConditionalClause expression,
                             int index)
Returns the JPQLQueryBNF that defines the fragment at the given position.

Specified by:
queryBNF in interface AbstractContentAssistVisitor.CollectionExpressionHelper<AbstractConditionalClause>
Parameters:
expression - The Expression being visited
index - 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

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference