Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.jpa.internal.jpql
Class ContentAssistVisitor

java.lang.Object
  extended by org.eclipse.persistence.jpa.internal.jpql.parser.AnonymousExpressionVisitor
      extended by org.eclipse.persistence.jpa.internal.jpql.AbstractVisitor
          extended by org.eclipse.persistence.jpa.internal.jpql.ContentAssistVisitor

All Implemented Interfaces:
ExpressionVisitor

public class ContentAssistVisitor
extends AbstractVisitor

This visitor traverses the JPQL parsed tree and gathers the possible proposals at a given position.

Example:

 // Have the external form of an IQuery
 IQuery query = ...

 // Create a JPQLQueryContext
 JPQLQueryContext context = new JPQLQueryContext();
 context.setQuery(query);

 // Create a map of the positions within the parsed tree
 QueryPosition queryPosition = context.getJPQLExpression().buildPosition(query.getExpression(), position);

 // Create the visitor and visit the parsed tree
 ContentAssistVisitor visitor = new ContentAssistVisitor(context);
 visitor.prepare(queryPosition);
 queryPosition.getExpression().accept(visitor);

 // Retrieve the proposals
 ContentAssistProposals proposals = visitor.getProposals();

 // Only required if the visitor is cached
 visitor.dispose();

 // Only required if the context is cached
 context.dispose();
 
Since:
2.3
Version:
2.3
Author:
Pascal Filion

Nested Class Summary
private  class ContentAssistVisitor.AbstractFromClauseSelectStatementHelper<T extends AbstractSelectStatement>
           
private  class ContentAssistVisitor.AbstractGroupByClauseSelectStatementHelper<T extends AbstractSelectStatement>
           
private  class ContentAssistVisitor.AbstractHavingClauseSelectStatementHelper<T extends AbstractSelectStatement>
           
private  class ContentAssistVisitor.AbstractSelectClauseSelectStatementHelper
           
private  class ContentAssistVisitor.AbstractWhereClauseSelectStatementHelper<T extends AbstractSelectStatement>
           
private  class ContentAssistVisitor.AcceptableTypeVisitor
          This visitor retrieves the permitted type from the path expression's parent.
private  class ContentAssistVisitor.AppendableExpressionVisitor
          This visitor scans the visited Expression and determines if a JPQL identifier can be added when the position is at the end of a clause and the ending of the clause can be seen as the beginning of an identifier.
private static interface ContentAssistVisitor.ClauseHelper<T extends Expression>
          This helper is responsible to add the proposals
private static interface ContentAssistVisitor.CollectionExpressionHelper<T extends Expression>
           
private  class ContentAssistVisitor.CollectionMappingFilter
           
private  class ContentAssistVisitor.CompletenessVisitor
           
private  class ContentAssistVisitor.CompoundExpressionHelper
          This helper is responsible to traverse the parsed tree and to determine if JPQL identifiers with a compound role can be appended after an Expression, which is based on the location of the cursor.
private  class ContentAssistVisitor.ConditionalExpressionCompletenessVisitor
          This visitor checks to see if the conditional expression is complete or not.
private  class ContentAssistVisitor.ConstrutorCollectionHelper
           
private  class ContentAssistVisitor.DefaultMappingCollector
          The default implementation of ContentAssistVisitor.DefaultMappingCollector, which simply returns an empty collection.
private  class ContentAssistVisitor.DeleteClauseHelper
           
private  class ContentAssistVisitor.DoubleEncapsulatedCollectionHelper
           
private  class ContentAssistVisitor.FilteringMappingCollector
          This ContentAssistVisitor.DefaultMappingCollector returns the possible mappings (non-collection type or collection type) from a managed type.
private  class ContentAssistVisitor.FromClauseCollectionHelper
           
private  class ContentAssistVisitor.FromClauseHelper
           
private  class ContentAssistVisitor.FromClauseSelectStatementHelper
           
private  class ContentAssistVisitor.GroupByClauseCollectionHelper
           
private  class ContentAssistVisitor.GroupByClauseSelectStatementHelper
           
private  class ContentAssistVisitor.HavingClauseHelper
           
private  class ContentAssistVisitor.HavingClauseSelectStatementHelper
           
private static class ContentAssistVisitor.IdentificationVariableType
          The various ways of retrieving identification variables from the declaration expression.
private  class ContentAssistVisitor.IncompleteCollectionExpressionVisitor
           
private  class ContentAssistVisitor.JoinCollectionHelper
           
private static interface ContentAssistVisitor.MappingCollector
          A collector is responsible to retrieve the possible proposals by using the mappings that can complete a path expression.
private  class ContentAssistVisitor.MappingFilterBuilder
          This visitor is responsible to create the right Filter<IMapping> based on the type of the Expression.
private  class ContentAssistVisitor.MappingTypeFilter
          This Filter is responsible to filter out the mappings that can't have their type assignable to the one passed in.
private  class ContentAssistVisitor.OrderByClauseCollectionHelper
           
private  class ContentAssistVisitor.OrderByClauseSelectStatementHelper
           
private  class ContentAssistVisitor.PropertyMappingFilter
           
private  class ContentAssistVisitor.RangeVariableDeclarationVisitor
           
private  class ContentAssistVisitor.ResultVariableVisitor
           
private  class ContentAssistVisitor.SelectClauseCompletenessVisitor
          This visitor checks the integrity of the select items.
private  class ContentAssistVisitor.SelectClauseSelectStatementHelper
           
private static interface ContentAssistVisitor.SelectStatementHelper<T extends AbstractSelectStatement,C extends Expression>
           
private  class ContentAssistVisitor.SimpleFromClauseSelectStatementHelper
           
private  class ContentAssistVisitor.SimpleGroupByClauseSelectStatementHelper
           
private  class ContentAssistVisitor.SimpleHavingClauseSelectStatementHelper
           
private  class ContentAssistVisitor.SimpleSelectClauseSelectStatementHelper
           
private  class ContentAssistVisitor.SimpleWhereClauseSelectStatementHelper
           
private  class ContentAssistVisitor.SubqueryVisitor
          This visitor determines if an Expression is in a subquery.
private  class ContentAssistVisitor.TrailingCompletenessVisitor
           
private  class ContentAssistVisitor.TripleEncapsulatedCollectionHelper
           
private  class ContentAssistVisitor.UpdateItemCollectionHelper
           
private  class ContentAssistVisitor.VisitParentVisitor
          This visitor is meant to adjust the corrections stack when traversing an Expression in order to increase the list of valid proposals.
private  class ContentAssistVisitor.WhereClauseHelper
           
private  class ContentAssistVisitor.WhereClauseSelectStatementHelper
           

 

Field Summary
private  java.util.Stack<java.lang.Integer> corrections
          This is used to change the position of the cursor in order to add possible proposals
private  java.util.Map<java.lang.Class<?>,java.lang.Object> helpers
          The cached helpers that are used by this visitor to add valid content assist proposals.
private  java.util.Stack<Expression> lockedExpressions
          Used to prevent and infinite recursion when one of the visit method is virtually asking a child expression to be visited.
private  java.util.Stack<java.lang.Integer> positionInCollections
          Used to determine if the cursor is an expression contained in a collection, if not, then this value is set to -1.
private  DefaultContentAssistProposals proposals
          The set of possible proposals gathered based on the position in the query.
private  QueryPosition queryPosition
          Contains the position of the cursor within the parsed Expression.
private static int SPACE_LENGTH
          A constant for the length of a whitespace, which is 1.
private  java.util.Stack<java.lang.Integer> virtualSpaces
          A virtual space is used to move the position by an amount of space in order to find some proposals within an expression.
private  java.lang.String word
          The current word, which was retrieved from the JPQL based on the position of the cursor.
private  WordParser wordParser
          This is used to retrieve words from the actual JPQL query.

 

Fields inherited from class org.eclipse.persistence.jpa.internal.jpql.AbstractVisitor
queryContext

 

Constructor Summary
ContentAssistVisitor(JPQLQueryContext queryContext)
          Creates a new ContentAssistVisitor.

 

Method Summary
private  java.lang.Iterable<IEntity> abstractSchemaTypes()
          Returns the collection of possible abstract schema types.
private  IType acceptableType(Expression expression)
          Determines the root IType that any type should be assignable.
private  void addAbstractSchemaTypes()
          Adds the abstract schema types as possible content assist proposals but will be filtered using the current word.
private  void addAbstractSchemaTypes(IType type)
          Adds the abstract schema types as possible content assist proposals but will be filtered using the current word and the entity's type will have to match the one from the given IType.
private  void addAggregate(java.lang.String identifier)
           
private  void addAllAggregates(JPQLQueryBNF queryBNF)
           
private  void addAllAggregates(java.lang.String queryBNFId)
           
private  void addAllClauses(JPQLQueryBNF queryBNF)
           
private  void addAllClauses(java.lang.String queryBNF)
           
private  void addAllCompounds(JPQLQueryBNF queryBNF)
           
private  void addAllCompounds(java.lang.String queryBNFId)
           
private  void addAllFunctions(JPQLQueryBNF queryBNF)
           
private  void addAllFunctions(JPQLQueryBNF queryBNF, int position)
           
private  void addAllFunctions(java.lang.String queryBNFId)
           
private  void addAllIdentificationVariables(Expression expression)
           
private  void addAllIdentifiers(JPQLQueryBNF queryBNF)
           
private  void addAllIdentifiers(java.lang.String queryBNFId)
           
private  void addClause(java.lang.String identifier)
           
private  void addCompound(java.lang.String identifier)
           
private  void addFunction(java.lang.String identifier, int position)
           
private  void addIdentificationVariable(java.lang.String identificationVariable)
           
private  void addIdentificationVariables(ContentAssistVisitor.IdentificationVariableType type, Expression expression)
          Adds the possible identifier variables as valid proposals but filter them based on the given type.
private  void addIdentifier(java.lang.String identifier, int position)
           
private  boolean addIdentifier(java.lang.String identifier, int position, java.lang.String partialEnding, int endIndex)
           
private  void addJoinIdentifiers()
           
private  void addLeftIdentificationVariables(Expression expression)
           
private  void addProposal(java.lang.String proposal)
           
private  void addProposal(java.lang.String identifier, java.lang.String word)
           
private  void addRangeIdentificationVariable(java.lang.String identificationVariable)
           
private  void addResultVariables(Expression expression)
           
private  void addScalarExpressionProposals(Expression expression)
           
private  void addSelectExpressionProposals(AbstractSelectClause expression, int length)
           
private  boolean addSelectExpressionProposals(Expression expression, int length, int index, boolean last)
           
private  ContentAssistVisitor.AppendableExpressionVisitor appendableExpressionVisitor()
           
private  ContentAssistVisitor.FilteringMappingCollector buildFilteringMappingCollector(AbstractPathExpression expression, Resolver resolver, Filter<IMapping> filter, java.lang.String pattern)
           
private  java.lang.Object buildHelper(java.lang.Class<?> helperClass)
           
private  ContentAssistVisitor.MappingCollector buildMappingCollector(AbstractPathExpression expression, Resolver resolver, Filter<IMapping> filter)
           
private  Filter<IMapping> buildMappingFilter(AbstractPathExpression expression, Filter<IMapping> filter)
           
private  ContentAssistVisitor.SelectStatementHelper<AbstractSelectStatement,Expression> cast(ContentAssistVisitor.SelectStatementHelper<? extends AbstractSelectStatement,? extends Expression> helper)
           
private  ContentAssistVisitor.CompletenessVisitor completenessVisitor()
           
private  ContentAssistVisitor.CompoundExpressionHelper compoundExpressionHelper()
           
private  ContentAssistVisitor.CompletenessVisitor conditionalExpressionCompletenessVisitor()
           
private  ContentAssistVisitor.ConstrutorCollectionHelper constructorCollectionHelper()
           
private  ContentAssistVisitor.MappingCollector defaultMappingCollector()
           
private  ContentAssistVisitor.ClauseHelper<DeleteClause> deleteClauseHelper()
           
 void dispose()
          Disposes of the internal data.
private  ContentAssistVisitor.DoubleEncapsulatedCollectionHelper doubleEncapsulatedCollectionHelper()
           
private  ContentAssistVisitor.AcceptableTypeVisitor expressionTypeVisitor()
           
private  int findExpressionPosition(CollectionExpression expression)
           
private  RangeVariableDeclaration findRangeVariableDeclaration(UpdateClause expression)
           
private  ContentAssistVisitor.FromClauseCollectionHelper fromClauseCollectionHelper()
           
private  ContentAssistVisitor.ClauseHelper<AbstractFromClause> fromClauseHelper()
           
private  ContentAssistVisitor.FromClauseSelectStatementHelper fromClauseSelectStatementHelper()
           
private
<T> T
getHelper(java.lang.Class<T> helperClass)
          Retrieves the helper associated with the given helper class.
 DefaultContentAssistProposals getProposals()
          Returns the object that contains the valid proposals based on the position of the cursor within the JPQL query.
private  ContentAssistVisitor.GroupByClauseCollectionHelper groupByClauseCollectionHelper()
           
private  ContentAssistVisitor.GroupByClauseSelectStatementHelper groupByClauseSelectStatementHelper()
           
private  ContentAssistVisitor.ClauseHelper<HavingClause> havingClauseHelper()
           
private  ContentAssistVisitor.HavingClauseSelectStatementHelper havingClauseSelectStatementHelper()
           
private  ContentAssistVisitor.CompletenessVisitor incompleteCollectionExpressionVisitor()
           
protected  void initialize()
          Initializes this class.
private  boolean isAggregate(java.lang.String proposal)
          Determines whether the given JPQL identifier used in an aggregate expression; for instance AND.
private  boolean isAppendable(Expression expression)
           
private  boolean isAppendableToCollection(Expression expression)
           
private  boolean isClause(java.lang.String identifier)
          Determines whether the given JPQL identifier used in a clause; for instance SELECT.
private  boolean isComplete(Expression expression)
           
private  boolean isCompoundable(Expression expression)
           
private  boolean isCompoundFunction(java.lang.String identifier)
          Determines whether the given JPQL identifier used in a compound expression; an example would be BETWEEN or MEMBER.
private  boolean isConditionalExpressionComplete(Expression expression)
           
private  boolean isFunction(java.lang.String identifier)
          Determines whether the given JPQL identifier is a function, an example would be AVG.
private  boolean isGroupByComplete(Expression expression)
           
private  boolean isInSubquery(Expression expression)
          Determines whether the given Expression is in a subquery or in the top-level query.
private  boolean isLocked(Expression expression)
           
private  boolean isPositionWithin(int position, int offset, java.lang.String word)
          Determines whether the given position is within the given word.
private  boolean isPositionWithin(int position, java.lang.String word)
          Determines whether the given position is within the given word.
private  boolean isPreviousClauseComplete(AbstractSelectStatement expression, ContentAssistVisitor.SelectStatementHelper<AbstractSelectStatement,Expression> helper)
           
private  boolean isResultVariable(Expression expression)
           
private  boolean isSelectExpressionComplete(Expression expression)
           
private  boolean isValidProposal(java.lang.String proposal, java.lang.String word)
          Determines whether the given proposal is a valid, which is based on the content of the given word.
private  boolean isValidVersion(java.lang.String identifier)
          Determines whether the given JPQL identifier can be a valid proposal, i.e. if it's part of the grammar of the JPA version that was used to parse the JPQL query.
private  ContentAssistVisitor.JoinCollectionHelper joinCollectionHelper()
           
private  int length(Expression expression)
          Returns the length of the string representation for the given Expression.
private  Filter<IMapping> mappingCollectionFilter()
           
private  Filter<IMapping> mappingFilter(Expression expression)
           
private  ContentAssistVisitor.MappingFilterBuilder mappingFilterBuilder()
           
private  Filter<IMapping> mappingPropertyFilter()
           
private  ContentAssistVisitor.OrderByClauseCollectionHelper orderByClauseCollectionHelper()
           
private  ContentAssistVisitor.OrderByClauseSelectStatementHelper orderByClauseSelectStatementHelper()
           
private  int position(Expression expression)
          Returns the position of the Expression within the parsed tree representation of the JPQL query.
 void prepare(QueryPosition queryPosition)
          Prepares this visitor by prepopulating it with the necessary data that is required to properly gather the list of proposals based on the caret position.
private  ContentAssistVisitor.RangeVariableDeclarationVisitor rangeVariableDeclarationVisitor()
           
private  ContentAssistVisitor.ResultVariableVisitor resultVariableVisitor()
           
private  ContentAssistVisitor.CompletenessVisitor selectClauseCompletenessVisitor()
           
private  ContentAssistVisitor.SelectClauseSelectStatementHelper selectClauseSelectStatementHelper()
           
private  ContentAssistVisitor.SimpleFromClauseSelectStatementHelper simpleFromClauseSelectStatementHelper()
           
private  ContentAssistVisitor.SimpleGroupByClauseSelectStatementHelper simpleGroupByClauseSelectStatementHelper()
           
private  ContentAssistVisitor.SimpleHavingClauseSelectStatementHelper simpleHavingClauseSelectStatementHelper()
           
private  ContentAssistVisitor.SimpleSelectClauseSelectStatementHelper simpleSelectClauseSelectStatementHelper()
           
private  ContentAssistVisitor.SimpleWhereClauseSelectStatementHelper simpleWhereClauseSelectStatementHelper()
           
private  ContentAssistVisitor.SubqueryVisitor subqueryVisitor()
           
private  ContentAssistVisitor.TripleEncapsulatedCollectionHelper tripleEncapsulatedCollectionHelper()
           
private  ContentAssistVisitor.UpdateItemCollectionHelper updateItemCollectionHelper()
           
 void visit(AbsExpression expression)
          Visits the AbsExpression expression.
 void visit(AbstractSchemaName expression)
          Visits the AbstractSchemaName expression.
 void visit(AdditionExpression expression)
          Visits the AdditionExpression expression.
 void visit(AllOrAnyExpression expression)
          Visits the AllOrAnyExpression expression.
 void visit(AndExpression expression)
          Visits the AndExpression expression.
 void visit(ArithmeticFactor expression)
          Visits the ArithmeticFactor expression.
 void visit(AvgFunction expression)
          Visits the AvgFunction expression.
 void visit(BadExpression expression)
          Visits the BadExpression expression.
 void visit(BetweenExpression expression)
          Visits the BetweenExpression expression.
 void visit(CaseExpression expression)
          Visits the CaseExpression expression.
 void visit(CoalesceExpression expression)
          Visits the CoalesceExpression expression.
 void visit(CollectionExpression expression)
          Visits the CollectionExpression expression.
 void visit(CollectionMemberDeclaration expression)
          Visits the CollectionMemberDeclaration expression.
 void visit(CollectionMemberExpression expression)
          Visits the CollectionMemberExpression expression.
 void visit(CollectionValuedPathExpression expression)
          Visits the CollectionValuedPathExpression expression.
 void visit(ComparisonExpression expression)
          Visits the ComparisonExpression expression.
 void visit(ConcatExpression expression)
          Visits the ConcatExpression expression.
 void visit(ConstructorExpression expression)
          Visits the ConstructorExpression expression.
 void visit(CountFunction expression)
          Visits the CountFunction expression.
 void visit(DateTime expression)
          Visits the DateTime expression.
 void visit(DeleteClause expression)
          Visits the DeleteClause expression.
 void visit(DeleteStatement expression)
          Visits the DeleteStatement expression.
 void visit(DivisionExpression expression)
          Visits the DivisionExpression expression.
 void visit(EmptyCollectionComparisonExpression expression)
          Visits the EmptyCollectionComparisonExpression expression.
 void visit(EntityTypeLiteral expression)
          Visits the EntityTypeLiteral expression.
 void visit(EntryExpression expression)
          Visits the EntryExpression expression.
 void visit(ExistsExpression expression)
          Visits the ExistsExpression expression.
protected  void visit(Expression expression)
          Blindly visit the given Expression.
 void visit(FromClause expression)
          Visits the FromClause expression.
 void visit(FuncExpression expression)
          Visits the FuncExpression expression.
 void visit(GroupByClause expression)
          Visits the GroupByClause expression.
 void visit(HavingClause expression)
          Visits the HavingClause expression.
 void visit(IdentificationVariable expression)
          Visits the IdentificationVariable expression.
 void visit(IdentificationVariableDeclaration expression)
          Visits the IdentificationVariableDeclaration expression.
 void visit(IndexExpression expression)
          Visits the IndexExpression expression.
 void visit(InExpression expression)
          Visits the InExpression expression.
 void visit(InputParameter expression)
          Visits the InputParameter expression.
 void visit(Join expression)
          Visits the Join expression.
 void visit(JoinFetch expression)
          Visits the FetchJoin expression.
 void visit(JPQLExpression expression)
          Visits the JPQLExpression expression.
 void visit(KeyExpression expression)
          Visits the KeyExpression expression.
 void visit(KeywordExpression expression)
          Visits the KeywordExpression expression.
 void visit(LengthExpression expression)
          Visits the LengthExpression expression.
 void visit(LikeExpression expression)
          Visits the LikeExpression expression.
 void visit(LocateExpression expression)
          Visits the LocateExpression expression.
 void visit(LowerExpression expression)
          Visits the LowerExpression expression.
 void visit(MaxFunction expression)
          Visits the MaxFunction expression.
 void visit(MinFunction expression)
          Visits the MinFunction expression.
 void visit(ModExpression expression)
          Visits the ModExpression expression.
 void visit(MultiplicationExpression expression)
          Visits the MultiplicationExpression expression.
 void visit(NotExpression expression)
          Visits the NotExpression expression.
 void visit(NullComparisonExpression expression)
          Visits the NullComparisonExpression expression.
 void visit(NullExpression expression)
          Visits the NullExpression expression.
 void visit(NullIfExpression expression)
          Visits the NullIfExpression expression.
 void visit(NumericLiteral expression)
          Visits the NumericLiteral expression.
 void visit(ObjectExpression expression)
          Visits the ObjectExpression expression.
 void visit(OrderByClause expression)
          Visits the OrderByClause expression.
 void visit(OrderByItem expression)
          Visits the OrderByItem expression.
 void visit(OrExpression expression)
          Visits the OrExpression expression.
 void visit(RangeVariableDeclaration expression)
          Visits the RangeVariableDeclaration expression.
 void visit(ResultVariable expression)
          Visits the ResultVariable expression.
 void visit(SelectClause expression)
          Visits the SelectClause expression.
 void visit(SelectStatement expression)
          Visits the SelectStatement expression.
 void visit(SimpleFromClause expression)
          Visits the SimpleFromClause expression.
 void visit(SimpleSelectClause expression)
          Visits the SimpleSelectClause expression.
 void visit(SimpleSelectStatement expression)
          Visits the SimpleSelectStatement expression.
 void visit(SizeExpression expression)
          Visits the SizeExpression expression.
 void visit(SqrtExpression expression)
          Visits the SqrtExpression expression.
 void visit(StateFieldPathExpression expression)
          Visits the StateFieldPathExpression expression.
 void visit(StringLiteral expression)
          Visits the StringLiteral expression.
 void visit(SubExpression expression)
          Visits the SubExpression expression.
 void visit(SubstringExpression expression)
          Visits the SubstringExpression expression.
 void visit(SubtractionExpression expression)
          Visits the SubtractionExpression expression.
 void visit(SumFunction expression)
          Visits the SumFunction expression.
 void visit(TreatExpression expression)
          Visits the TreatExpression expression.
 void visit(TrimExpression expression)
          Visits the TrimExpression expression.
 void visit(TypeExpression expression)
          Visits the TypeExpression expression.
 void visit(UnknownExpression expression)
          Visits the UnknownExpression expression.
 void visit(UpdateClause expression)
          Visits the UpdateClause expression.
 void visit(UpdateItem expression)
          Visits the UpdateItem expression.
 void visit(UpdateStatement expression)
          Visits the UpdateStatement expression.
 void visit(UpperExpression expression)
          Visits the UpperExpression expression.
 void visit(ValueExpression expression)
          Visits the ValueExpression expression.
 void visit(WhenClause expression)
          Visits the WhenClause expression.
 void visit(WhereClause expression)
          Visits the WhereClause expression.
private  void visitAggregateFunction(AggregateFunction expression)
           
private  void visitArithmeticExpression(ArithmeticExpression expression)
           
private
<T extends AbstractExpression>
void
visitClause(T expression, java.lang.String identifier, boolean hasSpaceAfterIdentifier, ContentAssistVisitor.ClauseHelper<T> helper)
           
private
<T extends Expression>
void
visitCollectionExpression(T expression, java.lang.String identifier, ContentAssistVisitor.CollectionExpressionHelper<T> helper)
          Adds the possible proposals for the given expression based on the location of the cursor and the content of the expression.
private  void visitCompoundableExpression(AbstractConditionalClause expression)
           
private  void visitCompoundableExpression(ContentAssistVisitor.CompoundExpressionHelper helper, int position, int length)
           
private  void visitDeleteStatement(DeleteStatement expression)
           
private  void visitEncapsulatedExpression(AbstractEncapsulatedExpression expression, java.lang.String identifier, java.lang.String jpqlQueryBNF)
          Adds the possible proposals for the given expression based on the location of the cursor and the content of the expression.
private  void visitLogicalExpression(LogicalExpression expression, java.lang.String identifier)
           
private  ContentAssistVisitor.VisitParentVisitor visitParentVisitor()
           
private  void visitPathExpression(AbstractPathExpression expression)
           
private  void visitPathExpression(AbstractPathExpression expression, Filter<IMapping> helper)
           
private  void visitSelectClause(AbstractSelectClause expression)
           
private  void visitSelectStatement(AbstractSelectStatement expression, ContentAssistVisitor.SelectStatementHelper<? extends AbstractSelectStatement,? extends Expression> helper)
           
private  ContentAssistVisitor.SelectStatementHelper<? extends AbstractSelectStatement,? extends Expression> visitSelectStatement(AbstractSelectStatement expression, int position, int[] length, ContentAssistVisitor.SelectStatementHelper<AbstractSelectStatement,Expression> helper)
           
private  void visitSingleEncapsulatedExpression(AbstractSingleEncapsulatedExpression expression, ContentAssistVisitor.IdentificationVariableType identificationVariableType)
          Adds the possible proposals for the given expression based on the location of the cursor and the content of the expression.
private  void visitSingleEncapsulatedExpression(AbstractSingleEncapsulatedExpression expression, ContentAssistVisitor.IdentificationVariableType identificationVariableType, java.lang.String... expressionIdentifiers)
          Adds the possible proposals for the given expression based on the location of the cursor and the content of the expression.
private  void visitUpdateStatement(UpdateStatement expression)
           
private  ContentAssistVisitor.ClauseHelper<WhereClause> whereClauseHelper()
           
private  ContentAssistVisitor.WhereClauseSelectStatementHelper whereClauseSelectStatementHelper()
           

 

Methods inherited from class org.eclipse.persistence.jpa.internal.jpql.AbstractVisitor
collectionExpression, embeddable, entity, getJPAVersion, getManagedType, getManagedType, getMapping, getProvider, getQuery, getQueryExpression, getResolver, getType, getType, getType, getTypeDeclaration, getTypeHelper, getTypeRepository, isEclipseLinkPlatform, isEmbeddable, isEntity, isJavaPlatform, isMappedSuperclass, isNull, mappedSuperclass

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

corrections

private java.util.Stack<java.lang.Integer> corrections
This is used to change the position of the cursor in order to add possible proposals

helpers

private java.util.Map<java.lang.Class<?>,java.lang.Object> helpers
The cached helpers that are used by this visitor to add valid content assist proposals.

lockedExpressions

private java.util.Stack<Expression> lockedExpressions
Used to prevent and infinite recursion when one of the visit method is virtually asking a child expression to be visited.

positionInCollections

private java.util.Stack<java.lang.Integer> positionInCollections
Used to determine if the cursor is an expression contained in a collection, if not, then this value is set to -1.

proposals

private DefaultContentAssistProposals proposals
The set of possible proposals gathered based on the position in the query.

queryPosition

private QueryPosition queryPosition
Contains the position of the cursor within the parsed Expression.

virtualSpaces

private java.util.Stack<java.lang.Integer> virtualSpaces
A virtual space is used to move the position by an amount of space in order to find some proposals within an expression. This is usually used when the trailing whitespace is not owned by the child expression but by one of its parents.

word

private java.lang.String word
The current word, which was retrieved from the JPQL based on the position of the cursor. The word is what is on the left side of the cursor.

wordParser

private WordParser wordParser
This is used to retrieve words from the actual JPQL query.

SPACE_LENGTH

private static final int SPACE_LENGTH
A constant for the length of a whitespace, which is 1.
See Also:
Constant Field Values

Constructor Detail

ContentAssistVisitor

public ContentAssistVisitor(JPQLQueryContext queryContext)
Creates a new ContentAssistVisitor.
Parameters:
queryContext - The context used to query information about the query

Method Detail

abstractSchemaTypes

private java.lang.Iterable<IEntity> abstractSchemaTypes()
Returns the collection of possible abstract schema types.
Returns:
The entities defined in the persistence context

acceptableType

private IType acceptableType(Expression expression)
Determines the root IType that any type should be assignable. If the IType is Number, than any subclasses will be allowed.
Parameters:
expression - The Expression to visit, including its parent hierarchy until an Expression requires a certain IType
Returns:
The root IType allowed or null if anything is allowed

addAbstractSchemaTypes

private void addAbstractSchemaTypes()
Adds the abstract schema types as possible content assist proposals but will be filtered using the current word.

addAbstractSchemaTypes

private void addAbstractSchemaTypes(IType type)
Adds the abstract schema types as possible content assist proposals but will be filtered using the current word and the entity's type will have to match the one from the given IType.
Parameters:
type - The IType used to filter the abstract schema types

addAggregate

private void addAggregate(java.lang.String identifier)

addAllAggregates

private void addAllAggregates(JPQLQueryBNF queryBNF)

addAllAggregates

private void addAllAggregates(java.lang.String queryBNFId)

addAllClauses

private void addAllClauses(JPQLQueryBNF queryBNF)

addAllClauses

private void addAllClauses(java.lang.String queryBNF)

addAllCompounds

private void addAllCompounds(JPQLQueryBNF queryBNF)

addAllCompounds

private void addAllCompounds(java.lang.String queryBNFId)

addAllFunctions

private void addAllFunctions(JPQLQueryBNF queryBNF)

addAllFunctions

private void addAllFunctions(JPQLQueryBNF queryBNF,
                             int position)

addAllFunctions

private void addAllFunctions(java.lang.String queryBNFId)

addAllIdentificationVariables

private void addAllIdentificationVariables(Expression expression)

addAllIdentifiers

private void addAllIdentifiers(JPQLQueryBNF queryBNF)

addAllIdentifiers

private void addAllIdentifiers(java.lang.String queryBNFId)

addClause

private void addClause(java.lang.String identifier)

addCompound

private void addCompound(java.lang.String identifier)

addFunction

private void addFunction(java.lang.String identifier,
                         int position)

addIdentificationVariable

private void addIdentificationVariable(java.lang.String identificationVariable)

addIdentificationVariables

private void addIdentificationVariables(ContentAssistVisitor.IdentificationVariableType type,
                                        Expression expression)
Adds the possible identifier variables as valid proposals but filter them based on the given type.

For instance, if the type is ContentAssistVisitor.IdentificationVariableType.LEFT, then any identification variables that have been defined before the given Expression are valid proposals, but those defined after are not valid proposals.

Parameters:
type - Which type of identification variables to add as valid proposals
expression - The Expression where the content assist was invoked, which helps to determine how to stop adding identification variable

addIdentifier

private void addIdentifier(java.lang.String identifier,
                           int position)

addIdentifier

private boolean addIdentifier(java.lang.String identifier,
                              int position,
                              java.lang.String partialEnding,
                              int endIndex)

addJoinIdentifiers

private void addJoinIdentifiers()

addLeftIdentificationVariables

private void addLeftIdentificationVariables(Expression expression)

addProposal

private void addProposal(java.lang.String proposal)

addProposal

private void addProposal(java.lang.String identifier,
                         java.lang.String word)

addRangeIdentificationVariable

private void addRangeIdentificationVariable(java.lang.String identificationVariable)

addResultVariables

private void addResultVariables(Expression expression)

addScalarExpressionProposals

private void addScalarExpressionProposals(Expression expression)

addSelectExpressionProposals

private void addSelectExpressionProposals(AbstractSelectClause expression,
                                          int length)

addSelectExpressionProposals

private boolean addSelectExpressionProposals(Expression expression,
                                             int length,
                                             int index,
                                             boolean last)

appendableExpressionVisitor

private ContentAssistVisitor.AppendableExpressionVisitor appendableExpressionVisitor()

buildFilteringMappingCollector

private ContentAssistVisitor.FilteringMappingCollector buildFilteringMappingCollector(AbstractPathExpression expression,
                                                                                      Resolver resolver,
                                                                                      Filter<IMapping> filter,
                                                                                      java.lang.String pattern)

buildHelper

private java.lang.Object buildHelper(java.lang.Class<?> helperClass)

buildMappingCollector

private ContentAssistVisitor.MappingCollector buildMappingCollector(AbstractPathExpression expression,
                                                                    Resolver resolver,
                                                                    Filter<IMapping> filter)

buildMappingFilter

private Filter<IMapping> buildMappingFilter(AbstractPathExpression expression,
                                            Filter<IMapping> filter)

cast

private ContentAssistVisitor.SelectStatementHelper<AbstractSelectStatement,Expression> cast(ContentAssistVisitor.SelectStatementHelper<? extends AbstractSelectStatement,? extends Expression> helper)

completenessVisitor

private ContentAssistVisitor.CompletenessVisitor completenessVisitor()

compoundExpressionHelper

private ContentAssistVisitor.CompoundExpressionHelper compoundExpressionHelper()

conditionalExpressionCompletenessVisitor

private ContentAssistVisitor.CompletenessVisitor conditionalExpressionCompletenessVisitor()

constructorCollectionHelper

private ContentAssistVisitor.ConstrutorCollectionHelper constructorCollectionHelper()

defaultMappingCollector

private ContentAssistVisitor.MappingCollector defaultMappingCollector()

deleteClauseHelper

private ContentAssistVisitor.ClauseHelper<DeleteClause> deleteClauseHelper()

dispose

public void dispose()
Disposes of the internal data.
Overrides:
dispose in class AbstractVisitor

doubleEncapsulatedCollectionHelper

private ContentAssistVisitor.DoubleEncapsulatedCollectionHelper doubleEncapsulatedCollectionHelper()

expressionTypeVisitor

private ContentAssistVisitor.AcceptableTypeVisitor expressionTypeVisitor()

findExpressionPosition

private int findExpressionPosition(CollectionExpression expression)

findRangeVariableDeclaration

private RangeVariableDeclaration findRangeVariableDeclaration(UpdateClause expression)

fromClauseCollectionHelper

private ContentAssistVisitor.FromClauseCollectionHelper fromClauseCollectionHelper()

fromClauseHelper

private ContentAssistVisitor.ClauseHelper<AbstractFromClause> fromClauseHelper()

fromClauseSelectStatementHelper

private ContentAssistVisitor.FromClauseSelectStatementHelper fromClauseSelectStatementHelper()

getHelper

private <T> T getHelper(java.lang.Class<T> helperClass)
Retrieves the helper associated with the given helper class. If not cached, the helper will be automatically created.
Parameters:
helperClass - The Java class of the helper to retrieve
Returns:
The helper being requested

getProposals

public DefaultContentAssistProposals getProposals()
Returns the object that contains the valid proposals based on the position of the cursor within the JPQL query.
Returns:
The list of proposals

groupByClauseCollectionHelper

private ContentAssistVisitor.GroupByClauseCollectionHelper groupByClauseCollectionHelper()

groupByClauseSelectStatementHelper

private ContentAssistVisitor.GroupByClauseSelectStatementHelper groupByClauseSelectStatementHelper()

havingClauseHelper

private ContentAssistVisitor.ClauseHelper<HavingClause> havingClauseHelper()

havingClauseSelectStatementHelper

private ContentAssistVisitor.HavingClauseSelectStatementHelper havingClauseSelectStatementHelper()

incompleteCollectionExpressionVisitor

private ContentAssistVisitor.CompletenessVisitor incompleteCollectionExpressionVisitor()

initialize

protected void initialize()
Initializes this class.
Overrides:
initialize in class AbstractVisitor

isAggregate

private boolean isAggregate(java.lang.String proposal)
Determines whether the given JPQL identifier used in an aggregate expression; for instance AND.
Parameters:
identifier - The identifier to validate
Returns:
true if the given identifier is used in an aggregate expression; false otherwise

isAppendable

private boolean isAppendable(Expression expression)

isAppendableToCollection

private boolean isAppendableToCollection(Expression expression)

isClause

private boolean isClause(java.lang.String identifier)
Determines whether the given JPQL identifier used in a clause; for instance SELECT.
Parameters:
identifier - The identifier to validate
Returns:
true if the given identifier is a clause; false otherwise

isComplete

private boolean isComplete(Expression expression)

isCompoundable

private boolean isCompoundable(Expression expression)

isCompoundFunction

private boolean isCompoundFunction(java.lang.String identifier)
Determines whether the given JPQL identifier used in a compound expression; an example would be BETWEEN or MEMBER.
Parameters:
identifier - The identifier to validate
Returns:
true if the given identifier is used in a compound expression; false otherwise

isConditionalExpressionComplete

private boolean isConditionalExpressionComplete(Expression expression)

isFunction

private boolean isFunction(java.lang.String identifier)
Determines whether the given JPQL identifier is a function, an example would be AVG.
Parameters:
identifier - The identifier to validate
Returns:
true if the given identifier is a function; false otherwise

isGroupByComplete

private boolean isGroupByComplete(Expression expression)

isInSubquery

private boolean isInSubquery(Expression expression)
Determines whether the given Expression is in a subquery or in the top-level query.
Parameters:
expression - The Expression to visit its parent hierarchy
Returns:
true if the owning query is a subquery; false if it's the top-level query

isLocked

private boolean isLocked(Expression expression)

isPositionWithin

private boolean isPositionWithin(int position,
                                 int offset,
                                 java.lang.String word)
Determines whether the given position is within the given word.

Example: position=0, word="JPQL" => true Example: position=1, word="JPQL" => true Example: position=4, word="JPQL" => true Example: position=5, word="JPQL" => true Example: position=5, offset 2, (actual cursor position is 3), word="JPQL" => true

Parameters:
position - The position of the cursor
offset - The offset to adjust the position
word - The word to check if the cursor is positioned in it
Returns:
true if the given position is within the given word; false otherwise

isPositionWithin

private boolean isPositionWithin(int position,
                                 java.lang.String word)
Determines whether the given position is within the given word.

Example: position=0, word="JPQL" => true Example: position=1, word="JPQL" => true Example: position=4, word="JPQL" => true Example: position=5, word="JPQL" => true

Parameters:
position - The position of the cursor
word - The word to check if the cursor is positioned in it
Returns:
true if the given position is within the given word; false otherwise

isPreviousClauseComplete

private boolean isPreviousClauseComplete(AbstractSelectStatement expression,
                                         ContentAssistVisitor.SelectStatementHelper<AbstractSelectStatement,Expression> helper)

isResultVariable

private boolean isResultVariable(Expression expression)

isSelectExpressionComplete

private boolean isSelectExpressionComplete(Expression expression)

isValidProposal

private boolean isValidProposal(java.lang.String proposal,
                                java.lang.String word)
Determines whether the given proposal is a valid, which is based on the content of the given word. If the word is not an empty string, the proposal must start with the content of the word.
Parameters:
proposal - The proposal to validate
word - The word, which is what was parsed before the position of the cursor
Returns:
true if the proposal is valid; false otherwise

isValidVersion

private boolean isValidVersion(java.lang.String identifier)
Determines whether the given JPQL identifier can be a valid proposal, i.e. if it's part of the grammar of the JPA version that was used to parse the JPQL query.
Parameters:
identifier - The JPQL identifier to validate
Returns:
true if the given identifier is part of the current JPA version or was defined in previous release; false otherwise

joinCollectionHelper

private ContentAssistVisitor.JoinCollectionHelper joinCollectionHelper()

length

private int length(Expression expression)
Returns the length of the string representation for the given Expression. The text containing any virtual text will be used.
Parameters:
expression - The Expression used to calculate the length of its string representation
Returns:
The length of the text, which may contain virtual text

mappingCollectionFilter

private Filter<IMapping> mappingCollectionFilter()

mappingFilter

private Filter<IMapping> mappingFilter(Expression expression)

mappingFilterBuilder

private ContentAssistVisitor.MappingFilterBuilder mappingFilterBuilder()

mappingPropertyFilter

private Filter<IMapping> mappingPropertyFilter()

orderByClauseCollectionHelper

private ContentAssistVisitor.OrderByClauseCollectionHelper orderByClauseCollectionHelper()

orderByClauseSelectStatementHelper

private ContentAssistVisitor.OrderByClauseSelectStatementHelper orderByClauseSelectStatementHelper()

position

private int position(Expression expression)
Returns the position of the Expression within the parsed tree representation of the JPQL query. The beginning of the string representation is the position returned.
Parameters:
expression - The Expression to find its position in the tree based on the string representation
Returns:
The position within the parsed tree of the given Expression

prepare

public void prepare(QueryPosition queryPosition)
Prepares this visitor by prepopulating it with the necessary data that is required to properly gather the list of proposals based on the caret position.
Parameters:
proposals - The object used to store the possible proposals gathered based on the position in the query
queryPosition - Contains the position of the cursor within the parsed Expression

rangeVariableDeclarationVisitor

private ContentAssistVisitor.RangeVariableDeclarationVisitor rangeVariableDeclarationVisitor()

resultVariableVisitor

private ContentAssistVisitor.ResultVariableVisitor resultVariableVisitor()

selectClauseCompletenessVisitor

private ContentAssistVisitor.CompletenessVisitor selectClauseCompletenessVisitor()

selectClauseSelectStatementHelper

private ContentAssistVisitor.SelectClauseSelectStatementHelper selectClauseSelectStatementHelper()

simpleFromClauseSelectStatementHelper

private ContentAssistVisitor.SimpleFromClauseSelectStatementHelper simpleFromClauseSelectStatementHelper()

simpleGroupByClauseSelectStatementHelper

private ContentAssistVisitor.SimpleGroupByClauseSelectStatementHelper simpleGroupByClauseSelectStatementHelper()

simpleHavingClauseSelectStatementHelper

private ContentAssistVisitor.SimpleHavingClauseSelectStatementHelper simpleHavingClauseSelectStatementHelper()

simpleSelectClauseSelectStatementHelper

private ContentAssistVisitor.SimpleSelectClauseSelectStatementHelper simpleSelectClauseSelectStatementHelper()

simpleWhereClauseSelectStatementHelper

private ContentAssistVisitor.SimpleWhereClauseSelectStatementHelper simpleWhereClauseSelectStatementHelper()

subqueryVisitor

private ContentAssistVisitor.SubqueryVisitor subqueryVisitor()

tripleEncapsulatedCollectionHelper

private ContentAssistVisitor.TripleEncapsulatedCollectionHelper tripleEncapsulatedCollectionHelper()

updateItemCollectionHelper

private ContentAssistVisitor.UpdateItemCollectionHelper updateItemCollectionHelper()

visit

public void visit(AbsExpression expression)
Visits the AbsExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(AbstractSchemaName expression)
Visits the AbstractSchemaName expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(AdditionExpression expression)
Visits the AdditionExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(AllOrAnyExpression expression)
Visits the AllOrAnyExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(AndExpression expression)
Visits the AndExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(ArithmeticFactor expression)
Visits the ArithmeticFactor expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(AvgFunction expression)
Visits the AvgFunction expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(BadExpression expression)
Visits the BadExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(BetweenExpression expression)
Visits the BetweenExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(CaseExpression expression)
Visits the CaseExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(CoalesceExpression expression)
Visits the CoalesceExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(CollectionExpression expression)
Visits the CollectionExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(CollectionMemberDeclaration expression)
Visits the CollectionMemberDeclaration expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(CollectionMemberExpression expression)
Visits the CollectionMemberExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(CollectionValuedPathExpression expression)
Visits the CollectionValuedPathExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(ComparisonExpression expression)
Visits the ComparisonExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(ConcatExpression expression)
Visits the ConcatExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(ConstructorExpression expression)
Visits the ConstructorExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(CountFunction expression)
Visits the CountFunction expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(DateTime expression)
Visits the DateTime expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(DeleteClause expression)
Visits the DeleteClause expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(DeleteStatement expression)
Visits the DeleteStatement expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(DivisionExpression expression)
Visits the DivisionExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(EmptyCollectionComparisonExpression expression)
Visits the EmptyCollectionComparisonExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(EntityTypeLiteral expression)
Visits the EntityTypeLiteral expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(EntryExpression expression)
Visits the EntryExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(ExistsExpression expression)
Visits the ExistsExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

protected void visit(Expression expression)
Blindly visit the given Expression.
Specified by:
visit in class AbstractVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(FromClause expression)
Visits the FromClause expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(FuncExpression expression)
Visits the FuncExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(GroupByClause expression)
Visits the GroupByClause expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(HavingClause expression)
Visits the HavingClause expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(IdentificationVariable expression)
Visits the IdentificationVariable expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(IdentificationVariableDeclaration expression)
Visits the IdentificationVariableDeclaration expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(IndexExpression expression)
Visits the IndexExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(InExpression expression)
Visits the InExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(InputParameter expression)
Visits the InputParameter expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(Join expression)
Visits the Join expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(JoinFetch expression)
Visits the FetchJoin expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(JPQLExpression expression)
Visits the JPQLExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(KeyExpression expression)
Visits the KeyExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(KeywordExpression expression)
Visits the KeywordExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(LengthExpression expression)
Visits the LengthExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(LikeExpression expression)
Visits the LikeExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(LocateExpression expression)
Visits the LocateExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(LowerExpression expression)
Visits the LowerExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(MaxFunction expression)
Visits the MaxFunction expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(MinFunction expression)
Visits the MinFunction expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(ModExpression expression)
Visits the ModExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(MultiplicationExpression expression)
Visits the MultiplicationExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(NotExpression expression)
Visits the NotExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(NullComparisonExpression expression)
Visits the NullComparisonExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(NullExpression expression)
Visits the NullExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(NullIfExpression expression)
Visits the NullIfExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(NumericLiteral expression)
Visits the NumericLiteral expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(ObjectExpression expression)
Visits the ObjectExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(OrderByClause expression)
Visits the OrderByClause expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(OrderByItem expression)
Visits the OrderByItem expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(OrExpression expression)
Visits the OrExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(RangeVariableDeclaration expression)
Visits the RangeVariableDeclaration expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(ResultVariable expression)
Visits the ResultVariable expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(SelectClause expression)
Visits the SelectClause expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(SelectStatement expression)
Visits the SelectStatement expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(SimpleFromClause expression)
Visits the SimpleFromClause expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(SimpleSelectClause expression)
Visits the SimpleSelectClause expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(SimpleSelectStatement expression)
Visits the SimpleSelectStatement expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(SizeExpression expression)
Visits the SizeExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(SqrtExpression expression)
Visits the SqrtExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(StateFieldPathExpression expression)
Visits the StateFieldPathExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(StringLiteral expression)
Visits the StringLiteral expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(SubExpression expression)
Visits the SubExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(SubstringExpression expression)
Visits the SubstringExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(SubtractionExpression expression)
Visits the SubtractionExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(SumFunction expression)
Visits the SumFunction expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(TreatExpression expression)
Visits the TreatExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(TrimExpression expression)
Visits the TrimExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(TypeExpression expression)
Visits the TypeExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(UnknownExpression expression)
Visits the UnknownExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(UpdateClause expression)
Visits the UpdateClause expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(UpdateItem expression)
Visits the UpdateItem expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(UpdateStatement expression)
Visits the UpdateStatement expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(UpperExpression expression)
Visits the UpperExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(ValueExpression expression)
Visits the ValueExpression expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(WhenClause expression)
Visits the WhenClause expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public void visit(WhereClause expression)
Visits the WhereClause expression.
Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visitAggregateFunction

private void visitAggregateFunction(AggregateFunction expression)

visitArithmeticExpression

private void visitArithmeticExpression(ArithmeticExpression expression)

visitClause

private <T extends AbstractExpression> void visitClause(T expression,
                                                        java.lang.String identifier,
                                                        boolean hasSpaceAfterIdentifier,
                                                        ContentAssistVisitor.ClauseHelper<T> helper)

visitCollectionExpression

private <T extends Expression> void visitCollectionExpression(T expression,
                                                              java.lang.String identifier,
                                                              ContentAssistVisitor.CollectionExpressionHelper<T> helper)
Adds the possible proposals for the given expression based on the location of the cursor and the content of the expression.
Parameters:
expression - The expression being visited
identifier -
helper -

visitCompoundableExpression

private void visitCompoundableExpression(AbstractConditionalClause expression)

visitCompoundableExpression

private void visitCompoundableExpression(ContentAssistVisitor.CompoundExpressionHelper helper,
                                         int position,
                                         int length)

visitDeleteStatement

private void visitDeleteStatement(DeleteStatement expression)

visitEncapsulatedExpression

private void visitEncapsulatedExpression(AbstractEncapsulatedExpression expression,
                                         java.lang.String identifier,
                                         java.lang.String jpqlQueryBNF)
Adds the possible proposals for the given expression based on the location of the cursor and the content of the expression.
Parameters:
expression - The expression being visited
identifier -
jpqlQueryBNF -

visitLogicalExpression

private void visitLogicalExpression(LogicalExpression expression,
                                    java.lang.String identifier)

visitParentVisitor

private ContentAssistVisitor.VisitParentVisitor visitParentVisitor()

visitPathExpression

private void visitPathExpression(AbstractPathExpression expression)

visitPathExpression

private void visitPathExpression(AbstractPathExpression expression,
                                 Filter<IMapping> helper)

visitSelectClause

private void visitSelectClause(AbstractSelectClause expression)

visitSelectStatement

private ContentAssistVisitor.SelectStatementHelper<? extends AbstractSelectStatement,? extends Expression> visitSelectStatement(AbstractSelectStatement expression,
                                                                                                                                int position,
                                                                                                                                int[] length,
                                                                                                                                ContentAssistVisitor.SelectStatementHelper<AbstractSelectStatement,Expression> helper)

visitSelectStatement

private void visitSelectStatement(AbstractSelectStatement expression,
                                  ContentAssistVisitor.SelectStatementHelper<? extends AbstractSelectStatement,? extends Expression> helper)

visitSingleEncapsulatedExpression

private void visitSingleEncapsulatedExpression(AbstractSingleEncapsulatedExpression expression,
                                               ContentAssistVisitor.IdentificationVariableType identificationVariableType)
Adds the possible proposals for the given expression based on the location of the cursor and the content of the expression.
Parameters:
expression - The expression being visited
identificationVariableType - The type of identification variables that can be added as possible proposals

visitSingleEncapsulatedExpression

private void visitSingleEncapsulatedExpression(AbstractSingleEncapsulatedExpression expression,
                                               ContentAssistVisitor.IdentificationVariableType identificationVariableType,
                                               java.lang.String... expressionIdentifiers)
Adds the possible proposals for the given expression based on the location of the cursor and the content of the expression.
Parameters:
expression - The expression being visited
identificationVariableType - The type of identification variables that can be added as possible proposals
expressionIdentifiers - Sometimes the expression may have more than one possible identifier, such as ALL, ANY and SOME are a possible JPQL identifier for a single expression (AllOrAnyExpression

visitUpdateStatement

private void visitUpdateStatement(UpdateStatement expression)

whereClauseHelper

private ContentAssistVisitor.ClauseHelper<WhereClause> whereClauseHelper()

whereClauseSelectStatementHelper

private ContentAssistVisitor.WhereClauseSelectStatementHelper whereClauseSelectStatementHelper()

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.