EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.jpa.jpql
Class DefaultContentAssistVisitor

java.lang.Object
  extended by org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
      extended by org.eclipse.persistence.jpa.jpql.AbstractContentAssistVisitor
          extended by org.eclipse.persistence.jpa.jpql.DefaultContentAssistVisitor
All Implemented Interfaces:
ExpressionVisitor

public class DefaultContentAssistVisitor
extends AbstractContentAssistVisitor

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();
 

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Version:
2.4.2
Author:
Pascal Filion
Since:
2.3

Nested Class Summary
protected  class DefaultContentAssistVisitor.AcceptableTypeVisitor
          The concrete instance that determines the return type of a function expression.
 
Nested classes/interfaces inherited from class org.eclipse.persistence.jpa.jpql.AbstractContentAssistVisitor
AbstractContentAssistVisitor.AbstractAppendableExpressionVisitor, AbstractContentAssistVisitor.AbstractConditionalClauseCollectionHelper, AbstractContentAssistVisitor.AbstractFromClauseStatementHelper<T extends AbstractSelectStatement>, AbstractContentAssistVisitor.AbstractGroupByClauseStatementHelper<T extends AbstractSelectStatement>, AbstractContentAssistVisitor.AbstractHavingClauseStatementHelper<T extends AbstractSelectStatement>, AbstractContentAssistVisitor.AbstractSelectClauseCollectionHelper<T extends AbstractSelectClause>, AbstractContentAssistVisitor.AbstractSelectClauseStatementHelper, AbstractContentAssistVisitor.AbstractWhereClauseSelectStatementHelper<T extends AbstractSelectStatement>, AbstractContentAssistVisitor.AppendableExpressionVisitor, AbstractContentAssistVisitor.AppendableType, AbstractContentAssistVisitor.CollectionExpressionHelper<T extends Expression>, AbstractContentAssistVisitor.CollectionExpressionVisitor, AbstractContentAssistVisitor.CollectionMappingFilter, AbstractContentAssistVisitor.CompletenessVisitor, AbstractContentAssistVisitor.CompoundExpressionHelper, AbstractContentAssistVisitor.CompoundTypeFilter, AbstractContentAssistVisitor.ConcatExpressionCollectionHelper, AbstractContentAssistVisitor.ConstrutorCollectionHelper, AbstractContentAssistVisitor.DeclarationVisitor, AbstractContentAssistVisitor.DefaultMappingCollector, AbstractContentAssistVisitor.DeleteClauseCollectionHelper, AbstractContentAssistVisitor.DeleteClauseStatementHelper, AbstractContentAssistVisitor.DoubleEncapsulatedCollectionHelper, AbstractContentAssistVisitor.EncapsulatedExpressionVisitor, AbstractContentAssistVisitor.EndingQueryPositionBuilder, AbstractContentAssistVisitor.EnumVisitor, AbstractContentAssistVisitor.FilteringMappingCollector, AbstractContentAssistVisitor.FollowingClausesVisitor, AbstractContentAssistVisitor.FollowingInvalidExpressionVisitor, AbstractContentAssistVisitor.FromClauseCollectionHelper, AbstractContentAssistVisitor.FromClauseStatementHelper, AbstractContentAssistVisitor.GroupByClauseCollectionHelper, AbstractContentAssistVisitor.GroupByClauseStatementHelper, AbstractContentAssistVisitor.HavingClauseStatementHelper, AbstractContentAssistVisitor.IdentificationVariableType, AbstractContentAssistVisitor.IncompleteCollectionExpressionVisitor, AbstractContentAssistVisitor.InvalidExpressionVisitor, AbstractContentAssistVisitor.JoinCollectionHelper, AbstractContentAssistVisitor.MappingCollector, AbstractContentAssistVisitor.MappingFilterBuilder, AbstractContentAssistVisitor.MappingTypeFilter, AbstractContentAssistVisitor.NotExpressionVisitor, AbstractContentAssistVisitor.OrderByClauseCollectionHelper, AbstractContentAssistVisitor.OrderByClauseStatementHelper, AbstractContentAssistVisitor.PropertyMappingFilter, AbstractContentAssistVisitor.RangeVariableDeclarationVisitor, AbstractContentAssistVisitor.ResultVariableVisitor, AbstractContentAssistVisitor.SelectClauseCollectionHelper, AbstractContentAssistVisitor.SelectClauseStatementHelper, AbstractContentAssistVisitor.SimpleFromClauseStatementHelper, AbstractContentAssistVisitor.SimpleGroupByClauseStatementHelper, AbstractContentAssistVisitor.SimpleHavingClauseStatementHelper, AbstractContentAssistVisitor.SimpleSelectClauseCollectionHelper, AbstractContentAssistVisitor.SimpleSelectClauseStatementHelper, AbstractContentAssistVisitor.SimpleWhereClauseSelectStatementHelper, AbstractContentAssistVisitor.StatementHelper<T extends Expression>, AbstractContentAssistVisitor.SubqueryAppendableExpressionVisitor, AbstractContentAssistVisitor.SubqueryVisitor, AbstractContentAssistVisitor.TrailingCompletenessVisitor, AbstractContentAssistVisitor.TripleEncapsulatedCollectionHelper, AbstractContentAssistVisitor.UpdateClauseStatementHelper, AbstractContentAssistVisitor.UpdateItemCollectionHelper, AbstractContentAssistVisitor.VisitParentVisitor, AbstractContentAssistVisitor.WhereClauseDeleteStatementHelper, AbstractContentAssistVisitor.WhereClauseSelectStatementHelper, AbstractContentAssistVisitor.WhereClauseUpdateStatementHelper, AbstractContentAssistVisitor.WithinInvalidExpressionVisitor
 
Field Summary
 
Fields inherited from class org.eclipse.persistence.jpa.jpql.AbstractContentAssistVisitor
compoundTypeFilters, corrections, helpers, lockedExpressions, proposals, queryContext, queryPosition, SPACE_LENGTH, virtualSpaces, word, wordParser
 
Constructor Summary
DefaultContentAssistVisitor(JPQLQueryContext queryContext)
          Creates a new DefaultContentAssistVisitor.
 
Method Summary
protected  DefaultContentAssistVisitor.AcceptableTypeVisitor buildAcceptableTypeVisitor()
          
protected  boolean isJoinFetchIdentifiable()
          Determines whether a JOIN FETCH expression can be identified by with an identification variable or not.
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.AbstractContentAssistVisitor
addAggregateIdentifier, addAggregateIdentifiers, addAggregateIdentifiers, addArithmeticIdentifiers, addClauseIdentifier, addClauseIdentifiers, addClauseIdentifiers, addComparisonIdentifiers, addCompositeIdentifier, addCompoundIdentifier, addCompoundIdentifiers, addCompoundIdentifiers, addEntities, addEntities, addExpressionFactoryIdentifiers, addExpressionFactoryIdentifiers, addFunctionIdentifier, addFunctionIdentifiers, addFunctionIdentifiers, addFunctionIdentifiers, addIdentificationVariable, addIdentificationVariables, addIdentificationVariables, addIdentifier, addJoinIdentifiers, addLeftIdentificationVariables, addLogicalIdentifiers, addRangeIdentificationVariable, addResultVariables, addVirtualSpace, areArithmeticSymbolsAppendable, areComparisonSymbolsAppendable, areLogicalSymbolsAppendable, buildAbstractConditionalClauseCollectionHelper, buildAppendableExpressionVisitor, buildCollectionExpressionVisitor, buildCollectionMappingFilter, buildCompoundExpressionHelper, buildConcatExpressionCollectionHelper, buildConstrutorCollectionHelper, buildDeclarationVisitor, buildDefaultMappingCollector, buildDeleteClauseCollectionHelper, buildDeleteClauseStatementHelper, buildDoubleEncapsulatedCollectionHelper, buildEmptyCompoundTypeFilter, buildEncapsulatedExpressionVisitor, buildEndingPositionFromInvalidExpression, buildEndingQueryPositionBuilder, buildEnumVisitor, buildFilteringMappingCollector, buildFollowingClausesVisitor, buildFollowingInvalidExpressionVisitor, buildFromClauseCollectionHelper, buildFromClauseStatementHelper, buildGroupByClauseCollectionHelper, buildGroupByClauseStatementHelper, buildHavingClauseStatementHelper, buildIncompleteCollectionExpressionVisitor, buildInvalidExpressionVisitor, buildJoinCollectionHelper, buildJPQLQueryBNFValidator, buildMappingCollector, buildMappingFilter, buildMappingFilter, buildMappingFilterBuilder, buildNotExpressionVisitor, buildOrderByClauseCollectionHelper, buildOrderByClauseStatementHelper, buildPropertyMappingFilter, buildProposals, buildRangeVariableDeclarationVisitor, buildResultVariableVisitor, buildSelectClauseCollectionHelper, buildSelectClauseStatementHelper, buildSimpleFromClauseStatementHelper, buildSimpleGroupByClauseStatementHelper, buildSimpleHavingClauseStatementHelper, buildSimpleSelectClauseCollectionHelper, buildSimpleSelectClauseStatementHelper, buildSimpleWhereClauseSelectStatementHelper, buildSubqueryAppendableExpressionVisitor, buildSubqueryVisitor, buildTrailingCompletenessVisitor, buildTripleEncapsulatedCollectionHelper, buildUpdateClauseStatementHelper, buildUpdateItemCollectionHelper, buildVisitParentVisitor, buildWhereClauseDeleteStatementHelper, buildWhereClauseSelectStatementHelper, buildWhereClauseUpdateStatementHelper, buildWithinInvalidExpressionVisitor, dispose, findRangeVariableDeclaration, getAbstractConditionalClauseCollectionHelper, getAcceptableType, getAppendableExpressionVisitor, getCollectionExpression, getCollectionExpressionVisitor, getCompoundExpressionHelper, getConcatExpressionCollectionHelper, getConstructorCollectionHelper, getCoumpoundTypeFilter, getDeclarationVisitor, getDefaultMappingCollector, getDeleteClauseCollectionHelper, getDeleteClauseStatementHelper, getDoubleEncapsulatedCollectionHelper, getEncapsulatedExpressionVisitor, getEndingQueryPositionBuilder, getEnumVisitor, getExpressionTypeVisitor, getFollowingClausesVisitor, getFollowingInvalidExpressionVisitor, getFromClauseCollectionHelper, getFromClauseStatementHelper, getGroupByClauseCollectionHelper, getGroupByClauseStatementHelper, getHavingClauseStatementHelper, getHelper, getIdentifierRole, getIncompleteCollectionExpressionVisitor, getInvalidExpressionVisitor, getJoinCollectionHelper, getMappingCollectionFilter, getMappingFilterBuilder, getMappingPropertyFilter, getNotExpressionVisitor, getOrderByClauseCollectionHelper, getOrderByClauseStatementHelper, getQueryBNF, getRangeVariableDeclarationVisitor, getResultVariableVisitor, getSelectClauseCollectionHelper, getSelectClauseStatementHelper, getSimpleFromClauseStatementHelper, getSimpleGroupByClauseStatementHelper, getSimpleHavingClauseStatementHelper, getSimpleSelectClauseCollectionHelper, getSimpleSelectClauseStatementHelper, getSimpleWhereClauseSelectStatementHelper, getSubqueryAppendableExpressionVisitor, getSubqueryVisitor, getTrailingCompletenessVisitor, getTripleEncapsulatedCollectionHelper, getUpdateClauseStatementHelper, getUpdateItemCollectionHelper, getVisitParentVisitor, getWhereClauseDeleteStatementHelper, getWhereClauseSelectStatementHelper, getWhereClauseUpdateStatementHelper, getWithinInvalidExpressionVisitor, hasClausesDefinedBetween, hasVirtualSpace, initialize, isAggregate, isAppendable, isAppendableToCollection, isClause, isClauseAppendable, isComplete, isCompoundable, isCompoundFunction, isDeclaration, isEncapsulated, isEnumAllowed, isFollowingInvalidExpression, isFunction, isInSubquery, isInvalidExpression, isLocked, isNotExpression, isPositionWithin, isPositionWithin, isSubqueryAppendable, isValid, isValid, isValid, isValid, isValid, isValidProposal, isValidVersion, isWithinInvalidExpression, registerHelper, removeVirtualSpace, toString, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitAggregateFunction, visitArithmeticExpression, visitCollectionExpression, visitEndingExpression, visitInvalidExpression, visitLogicalExpression, visitPathExpression, visitPathExpression, visitSingleEncapsulatedExpression, visitSingleEncapsulatedExpression, visitStatement, visitThirdPartyPathExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultContentAssistVisitor

public DefaultContentAssistVisitor(JPQLQueryContext queryContext)
Creates a new DefaultContentAssistVisitor.

Parameters:
queryContext - The context used to query information about the query
Throws:
java.lang.NullPointerException - The JPQLQueryContext cannot be null
Method Detail

buildAcceptableTypeVisitor

protected DefaultContentAssistVisitor.AcceptableTypeVisitor buildAcceptableTypeVisitor()

Specified by:
buildAcceptableTypeVisitor in class AbstractContentAssistVisitor

isJoinFetchIdentifiable

protected boolean isJoinFetchIdentifiable()
Determines whether a JOIN FETCH expression can be identified by with an identification variable or not.

Specified by:
isJoinFetchIdentifiable in class AbstractContentAssistVisitor
Returns:
true if the expression can have an identification variable; false otherwise

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference