public class DefaultContentAssistVisitor extends AbstractContentAssistVisitor
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);
// Either a real extension that adds additional support or
ContentAssistExtension extension = ContentAssistExtension.NULL_HELPER
;
// Create the visitor and visit the parsed tree
DefaultContentAssistVisitor visitor = new DefaultContentAssistVisitor(context);
visitor.buildProposals(queryPosition.getPosition(), extension)
;
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.
Modifier and Type | Class and Description |
---|---|
protected class |
DefaultContentAssistVisitor.AcceptableTypeVisitor
The concrete instance that determines the return type of a function expression.
|
AbstractContentAssistVisitor.AbstractAppendableExpressionVisitor, AbstractContentAssistVisitor.AbstractConditionalClauseCollectionHelper<T extends Expression>, 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.ConcatExpressionCollectionHelper, AbstractContentAssistVisitor.ConditionalClauseCollectionHelper, AbstractContentAssistVisitor.ConstrutorCollectionHelper, AbstractContentAssistVisitor.DeclarationVisitor, AbstractContentAssistVisitor.DefaultMappingCollector, AbstractContentAssistVisitor.DeleteClauseCollectionHelper, AbstractContentAssistVisitor.DeleteClauseStatementHelper, AbstractContentAssistVisitor.DifferentComparisonFilter, 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.TripleEncapsulatedCollectionHelper, AbstractContentAssistVisitor.UpdateClauseStatementHelper, AbstractContentAssistVisitor.UpdateItemCollectionHelper, AbstractContentAssistVisitor.VisitParentVisitor, AbstractContentAssistVisitor.WhenClauseConditionalClauseCollectionHelper, AbstractContentAssistVisitor.WhereClauseDeleteStatementHelper, AbstractContentAssistVisitor.WhereClauseSelectStatementHelper, AbstractContentAssistVisitor.WhereClauseUpdateStatementHelper, AbstractContentAssistVisitor.WithinInvalidExpressionVisitor
corrections, helpers, identifierFilters, INVALID_IDENTIFIER_FILTER, lockedExpressions, proposals, queryContext, queryPosition, SPACE_LENGTH, VALID_IDENTIFIER_FILTER, virtualSpaces, word, wordParser
Constructor and Description |
---|
DefaultContentAssistVisitor(JPQLQueryContext queryContext)
Creates a new
DefaultContentAssistVisitor . |
Modifier and Type | Method and Description |
---|---|
protected DefaultContentAssistVisitor.AcceptableTypeVisitor |
buildAcceptableTypeVisitor() |
protected JPQLGrammar |
getLatestGrammar()
Returns the latest supported JPQL grammar, which is required when checking the validity of a
JPQL identifier.
|
protected boolean |
isJoinFetchIdentifiable()
Determines whether a
JOIN FETCH expression can be identified by with an
identification variable or not. |
addAggregateIdentifier, addAggregateIdentifiers, addAggregateIdentifiers, addArithmeticIdentifiers, addClauseIdentifier, addClauseIdentifiers, addClauseIdentifiers, addComparisonIdentifiers, addCompositeIdentifier, addCompoundIdentifier, addCompoundIdentifiers, addCompoundIdentifiers, addEntities, addEntities, addEnumConstant, addEnumConstants, addExpressionFactoryIdentifiers, addExpressionFactoryIdentifiers, addFunctionIdentifier, addFunctionIdentifiers, addFunctionIdentifiers, addFunctionIdentifiers, addIdentificationVariable, addIdentificationVariables, addIdentificationVariables, addIdentifier, addJoinIdentifiers, addLeftIdentificationVariables, addLogicalIdentifiers, addRangeIdentificationVariable, addResultVariables, addVirtualSpace, areArithmeticSymbolsAppendable, areComparisonSymbolsAppendable, areLogicalSymbolsAppendable, buildAppendableExpressionVisitor, buildCollectionCompoundTypeFilter, buildCollectionExpressionVisitor, buildCollectionMappingFilter, buildConcatExpressionCollectionHelper, buildConditionalClauseCollectionHelper, buildConstrutorCollectionHelper, buildDeclarationVisitor, buildDefaultMappingCollector, buildDeleteClauseCollectionHelper, buildDeleteClauseStatementHelper, buildDifferentComparisonFilter, buildDoubleEncapsulatedCollectionHelper, buildEncapsulatedExpressionVisitor, buildEndingPositionFromInvalidExpression, buildEndingQueryPositionBuilder, buildEnumVisitor, buildFilteringMappingCollector, buildFollowingClausesVisitor, buildFollowingInvalidExpressionVisitor, buildFromClauseCollectionHelper, buildFromClauseStatementHelper, buildGroupByClauseCollectionHelper, buildGroupByClauseStatementHelper, buildHavingClauseStatementHelper, buildIncompleteCollectionExpressionVisitor, buildInvalidExpressionVisitor, buildJoinCollectionHelper, buildJPQLQueryBNFValidator, buildMappingCollector, buildMappingFilter, buildMappingFilter, buildMappingFilterBuilder, buildNonCollectionCompoundTypeFilter, buildNotExpressionVisitor, buildOrderByClauseCollectionHelper, buildOrderByClauseStatementHelper, buildPropertyMappingFilter, buildProposals, buildProposals, buildRangeVariableDeclarationVisitor, buildResultVariableVisitor, buildSelectClauseCollectionHelper, buildSelectClauseStatementHelper, buildSimpleFromClauseStatementHelper, buildSimpleGroupByClauseStatementHelper, buildSimpleHavingClauseStatementHelper, buildSimpleSelectClauseCollectionHelper, buildSimpleSelectClauseStatementHelper, buildSimpleWhereClauseSelectStatementHelper, buildSubqueryAppendableExpressionVisitor, buildSubqueryVisitor, buildTripleEncapsulatedCollectionHelper, buildUpdateClauseStatementHelper, buildUpdateItemCollectionHelper, buildVisitParentVisitor, buildWhenClauseConditionalClauseCollectionHelper, buildWhereClauseDeleteStatementHelper, buildWhereClauseSelectStatementHelper, buildWhereClauseUpdateStatementHelper, buildWithinInvalidExpressionVisitor, dispose, findRangeVariableDeclaration, getAcceptableType, getAppendableExpressionVisitor, getCollectionExpression, getCollectionExpressionVisitor, getConcatExpressionCollectionHelper, getConditionalClauseCollectionHelper, getConstructorCollectionHelper, getDeclarationVisitor, getDefaultMappingCollector, getDeleteClauseCollectionHelper, getDeleteClauseStatementHelper, getDoubleEncapsulatedCollectionHelper, getEncapsulatedExpressionVisitor, getEndingQueryPositionBuilder, getEnumVisitor, getExpressionFactory, getExpressionTypeVisitor, getFilter, 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, getTripleEncapsulatedCollectionHelper, getUpdateClauseStatementHelper, getUpdateItemCollectionHelper, getVisitParentVisitor, getWhenClauseConditionalClauseCollectionHelper, 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, visitEnumConstant, visitInvalidExpression, visitLogicalExpression, visitPathExpression, visitPathExpression, visitSingleEncapsulatedExpression, visitSingleEncapsulatedExpression, visitStatement, visitThirdPartyPathExpression
public DefaultContentAssistVisitor(JPQLQueryContext queryContext)
DefaultContentAssistVisitor
.queryContext
- The context used to query information about the queryjava.lang.NullPointerException
- The JPQLQueryContext
cannot be null
protected DefaultContentAssistVisitor.AcceptableTypeVisitor buildAcceptableTypeVisitor()
buildAcceptableTypeVisitor
in class AbstractContentAssistVisitor
protected JPQLGrammar getLatestGrammar()
getLatestGrammar
in class AbstractContentAssistVisitor
JPQLGrammar
supported by the providerprotected boolean isJoinFetchIdentifiable()
JOIN FETCH
expression can be identified by with an
identification variable or not.isJoinFetchIdentifiable
in class AbstractContentAssistVisitor
true
if the expression can have an identification variable;
false
otherwise