Class AbstractContentAssistVisitor
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
-
- org.eclipse.persistence.jpa.jpql.tools.AbstractContentAssistVisitor
-
- All Implemented Interfaces:
ExpressionVisitor
- Direct Known Subclasses:
DefaultContentAssistVisitor,EclipseLinkContentAssistVisitor
public abstract class AbstractContentAssistVisitor extends AnonymousExpressionVisitor
The visitor provides support for finding the possible proposals within a JPQL query at a certain position.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.5
- Author:
- Pascal Filion
- Since:
- 2.4
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Stack<java.lang.Integer>correctionsThis is used to change the position of the cursor in order to add possible proposalsprotected java.util.Map<java.lang.Class<?>,java.lang.Object>helpersThe cached helpers that are used by this visitor to add valid content assist proposals.protected java.util.Map<java.lang.String,Filter<Expression>>identifierFiltersThis map contains theFilterthat is used to determine when an identifier is a valid proposal, some of them depends on the expression's type.protected static Filter<Expression>INVALID_IDENTIFIER_FILTERThisFilteris used to say theExpressionis invalid without doing anything.protected java.util.Stack<Expression>lockedExpressionsUsed to prevent and infinite recursion when one of the visit method is virtually asking a child expression to be visited.protected DefaultContentAssistProposalsproposalsThe set of possible proposals gathered based on the position in the query.protected JPQLQueryContextqueryContextThe context used to query information about the JPQL query.protected QueryPositionqueryPositionContains the position of the cursor within the parsedExpressionfrom the root node up to the deepest leaf node.protected static intSPACE_LENGTHA constant for the length of a whitespace, which is 1.protected static Filter<Expression>VALID_IDENTIFIER_FILTERThisFilteris used to say theExpressionis valid without doing anything.protected java.util.Stack<java.lang.Integer>virtualSpacesA virtual space is used to move the position of the cursor by adding an extra space in order to find some proposals within an expression.protected java.lang.StringwordThe current word, which was retrieved from the JPQL query based on the position of the cursor.protected WordParserwordParserThis is used to retrieve words from the actual JPQL query.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractContentAssistVisitor(JPQLQueryContext queryContext)Creates a newAbstractContentAssistVisitor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddAggregateIdentifier(java.lang.String identifier)Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.AGGREGATEand the beginning starts with the current word.protected voidaddAggregateIdentifiers(java.lang.String queryBNFId)Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.AGGREGATEand the beginning starts with the current word.protected voidaddAggregateIdentifiers(JPQLQueryBNF queryBNF)Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.AGGREGATEand the beginning starts with the current word.protected voidaddArithmeticIdentifiers()Adds the JPQL identifiers which correspond to the arithmetic operators as valid proposals.protected voidaddClauseIdentifier(java.lang.String identifier)Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.CLAUSEand the beginning starts with the current word.protected voidaddClauseIdentifiers(java.lang.String queryBNFId)Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.CLAUSEand the beginning starts with the current word.protected voidaddClauseIdentifiers(JPQLQueryBNF queryBNF)Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.CLAUSEand the beginning starts with the current word.protected voidaddComparisonIdentifiers(Expression expression)Adds the JPQL identifiers which correspond to the comparison operators as valid proposals.protected voidaddCompositeIdentifier(java.lang.String identifier, int offset)Adds the composite JPQL identifier by following the given rules: If the word is empty and the offset is -1, then use the rule used byaddIdentifier(String); Otherwise checks the ending of the JPQL query with a portion of the identifier from the entire length of the identifier to the given offset by cutting off the trailing characters.protected voidaddCompoundIdentifier(java.lang.String identifier, Expression expression, boolean hasIs, boolean hasNot)Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.COMPOUND_FUNCTIONand the beginning starts with the current word.protected voidaddCompoundIdentifiers(java.lang.String queryBNFId, Expression expression, boolean hasIs, boolean hasNot)Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.COMPOUND_FUNCTIONand the beginning starts with the current word.protected voidaddCompoundIdentifiers(JPQLQueryBNF queryBNF, Expression expression, boolean hasIs, boolean hasNot)Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.COMPOUND_FUNCTIONand the beginning starts with the current word.protected voidaddEntities()Adds the entities as possible content assist proposals but will be filtered using the current word.protected voidaddEntities(IType type)Adds the entities as possible content assist proposals but will be filtered using the current word and the entity's type will have to be assignable from the givenIType.protected voidaddEnumConstant(IType enumType, java.lang.String enumConstant)Adds the given enum constant as a valid proposal.protected voidaddEnumConstants(IType enumType, java.lang.String word)Adds the constants of the given enum type as valid proposals if the beginning starts with the given word.protected voidaddExpressionFactoryIdentifiers(java.lang.String expressionFactoryId)Adds the JPQL identifiers that were registered with theExpressionFactorywith the given unique identifier.protected voidaddExpressionFactoryIdentifiers(ExpressionFactory expressionFactory)Adds the JPQL identifiers that were registered with the givenExpressionFactory.protected voidaddFunctionIdentifier(java.lang.String identifier)Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.FUNCTIONand the beginning starts with the current word.protected voidaddFunctionIdentifiers(java.lang.String queryBNFId)Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.FUNCTIONand the beginning starts with the current word.protected voidaddFunctionIdentifiers(Expression expression)Adds the JPQL identifiers for which their role isFUNCTIONby determining theJPQLQueryBNFthat represents the fragment for which the givenExpressionwas parsed.protected voidaddFunctionIdentifiers(JPQLQueryBNF queryBNF)Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.FUNCTIONand the beginning starts with the current word.protected voidaddIdentificationVariable(java.lang.String identificationVariable)Adds the given identification variable as a valid proposal.protected voidaddIdentificationVariables()Adds all the identification variables defined in the current query's FROM clause.protected voidaddIdentificationVariables(Expression expression, AbstractContentAssistVisitor.IdentificationVariableType type)Adds the possible identification variables as valid proposals but filter them based on the given type.protected voidaddIdentifier(java.lang.String identifier)Adds the given identifier as a proposal if it passes the checks.protected voidaddJoinIdentifiers()Adds the join specification identifiers as proposals.protected voidaddLeftIdentificationVariables(Expression expression)Adds the identification variables defined in the current query's FROM clause that are declared before the givenExpression.protected voidaddLogicalIdentifiers()Adds the logical identifiers, which areANDandOR.protected voidaddRangeIdentificationVariable(java.lang.String identificationVariable)Adds the given identification variable as a proposal if it passes the checks.protected voidaddResultVariables()Adds the result variables defined in theSELECTclause as valid proposals.protected voidaddVirtualSpace()Adds a virtual space on the stack.protected booleanareArithmeticSymbolsAppendable(Expression expression)Determines whether the givenExpressioncan be followed by an arithmetic operator.protected booleanareComparisonSymbolsAppendable(Expression expression)Determines whether the givenExpressioncan be followed by a comparison operator.protected booleanareLogicalSymbolsAppendable(Expression expression)Determines whether the givenExpressioncan be followed by a logical operator.protected abstract AbstractContentAssistVisitor.AcceptableTypeVisitorbuildAcceptableTypeVisitor()protected AbstractContentAssistVisitor.AppendableExpressionVisitorbuildAppendableExpressionVisitor()protected Filter<Expression>buildCollectionCompoundTypeFilter()protected AbstractContentAssistVisitor.CollectionExpressionVisitorbuildCollectionExpressionVisitor()protected AbstractContentAssistVisitor.CollectionMappingFilterbuildCollectionMappingFilter()protected AbstractContentAssistVisitor.ConcatExpressionCollectionHelperbuildConcatExpressionCollectionHelper()protected AbstractContentAssistVisitor.ConditionalClauseCollectionHelperbuildConditionalClauseCollectionHelper()protected AbstractContentAssistVisitor.ConstrutorCollectionHelperbuildConstrutorCollectionHelper()protected AbstractContentAssistVisitor.DeclarationVisitorbuildDeclarationVisitor()protected AbstractContentAssistVisitor.DefaultMappingCollectorbuildDefaultMappingCollector()protected AbstractContentAssistVisitor.DeleteClauseCollectionHelperbuildDeleteClauseCollectionHelper()protected AbstractContentAssistVisitor.DeleteClauseStatementHelperbuildDeleteClauseStatementHelper()protected Filter<Expression>buildDifferentComparisonFilter()protected AbstractContentAssistVisitor.DoubleEncapsulatedCollectionHelperbuildDoubleEncapsulatedCollectionHelper()protected AbstractContentAssistVisitor.EncapsulatedExpressionVisitorbuildEncapsulatedExpressionVisitor()protected QueryPositionbuildEndingPositionFromInvalidExpression(Expression invalidExpression, Expression startingPointExpression, boolean[] virtualSpace)Creates a newQueryPositioncontaining the corrected positions starting at the givenExpressionand traversing the children at is always at the right side of the tree.protected AbstractContentAssistVisitor.EndingQueryPositionBuilderbuildEndingQueryPositionBuilder()protected AbstractContentAssistVisitor.EnumVisitorbuildEnumVisitor()protected AbstractContentAssistVisitor.FilteringMappingCollectorbuildFilteringMappingCollector(AbstractPathExpression expression, Resolver resolver, Filter<IMapping> filter, java.lang.String pattern)protected AbstractContentAssistVisitor.FollowingClausesVisitorbuildFollowingClausesVisitor()protected AbstractContentAssistVisitor.FollowingInvalidExpressionVisitorbuildFollowingInvalidExpressionVisitor()protected AbstractContentAssistVisitor.FromClauseCollectionHelperbuildFromClauseCollectionHelper()protected AbstractContentAssistVisitor.FromClauseStatementHelperbuildFromClauseStatementHelper()protected AbstractContentAssistVisitor.GroupByClauseCollectionHelperbuildGroupByClauseCollectionHelper()protected AbstractContentAssistVisitor.GroupByClauseStatementHelperbuildGroupByClauseStatementHelper()protected AbstractContentAssistVisitor.HavingClauseStatementHelperbuildHavingClauseStatementHelper()protected AbstractContentAssistVisitor.IncompleteCollectionExpressionVisitorbuildIncompleteCollectionExpressionVisitor()protected AbstractContentAssistVisitor.InvalidExpressionVisitorbuildInvalidExpressionVisitor()protected AbstractContentAssistVisitor.JoinCollectionHelperbuildJoinCollectionHelper()protected AbstractValidator.JPQLQueryBNFValidatorbuildJPQLQueryBNFValidator(JPQLQueryBNF queryBNF)Returns theAbstractValidator.JPQLQueryBNFValidatorthat can be used to validate anExpressionby making sure its BNF is part of the given BNF.protected AbstractContentAssistVisitor.MappingCollectorbuildMappingCollector(AbstractPathExpression expression, Resolver resolver, Filter<IMapping> filter)protected Filter<IMapping>buildMappingFilter(AbstractPathExpression expression, Filter<IMapping> filter)protected Filter<IMapping>buildMappingFilter(Expression expression)protected AbstractContentAssistVisitor.MappingFilterBuilderbuildMappingFilterBuilder()protected Filter<Expression>buildNonCollectionCompoundTypeFilter()protected AbstractContentAssistVisitor.NotExpressionVisitorbuildNotExpressionVisitor()protected AbstractContentAssistVisitor.OrderByClauseCollectionHelperbuildOrderByClauseCollectionHelper()protected AbstractContentAssistVisitor.OrderByClauseStatementHelperbuildOrderByClauseStatementHelper()protected AbstractContentAssistVisitor.PropertyMappingFilterbuildPropertyMappingFilter()ContentAssistProposalsbuildProposals(int position)Prepares this visitor by prepopulating it with the necessary data that is required to properly gather the list of proposals based on the given caret position.ContentAssistProposalsbuildProposals(int position, ContentAssistExtension extension)Prepares this visitor by prepopulating it with the necessary data that is required to properly gather the list of proposals based on the given caret position.protected AbstractContentAssistVisitor.RangeVariableDeclarationVisitorbuildRangeVariableDeclarationVisitor()protected AbstractContentAssistVisitor.ResultVariableVisitorbuildResultVariableVisitor()protected AbstractContentAssistVisitor.SelectClauseCollectionHelperbuildSelectClauseCollectionHelper()protected AbstractContentAssistVisitor.SelectClauseStatementHelperbuildSelectClauseStatementHelper()protected AbstractContentAssistVisitor.SimpleFromClauseStatementHelperbuildSimpleFromClauseStatementHelper()protected AbstractContentAssistVisitor.SimpleGroupByClauseStatementHelperbuildSimpleGroupByClauseStatementHelper()protected AbstractContentAssistVisitor.SimpleHavingClauseStatementHelperbuildSimpleHavingClauseStatementHelper()protected AbstractContentAssistVisitor.SimpleSelectClauseCollectionHelperbuildSimpleSelectClauseCollectionHelper()protected AbstractContentAssistVisitor.SimpleSelectClauseStatementHelperbuildSimpleSelectClauseStatementHelper()protected AbstractContentAssistVisitor.SimpleWhereClauseSelectStatementHelperbuildSimpleWhereClauseSelectStatementHelper()protected AbstractContentAssistVisitor.SubqueryAppendableExpressionVisitorbuildSubqueryAppendableExpressionVisitor()protected AbstractContentAssistVisitor.SubqueryVisitorbuildSubqueryVisitor()protected AbstractContentAssistVisitor.TripleEncapsulatedCollectionHelperbuildTripleEncapsulatedCollectionHelper()protected AbstractContentAssistVisitor.UpdateClauseStatementHelperbuildUpdateClauseStatementHelper()protected AbstractContentAssistVisitor.UpdateItemCollectionHelperbuildUpdateItemCollectionHelper()protected AbstractContentAssistVisitor.VisitParentVisitorbuildVisitParentVisitor()protected AbstractContentAssistVisitor.WhenClauseConditionalClauseCollectionHelperbuildWhenClauseConditionalClauseCollectionHelper()protected AbstractContentAssistVisitor.WhereClauseDeleteStatementHelperbuildWhereClauseDeleteStatementHelper()protected AbstractContentAssistVisitor.WhereClauseSelectStatementHelperbuildWhereClauseSelectStatementHelper()protected AbstractContentAssistVisitor.WhereClauseUpdateStatementHelperbuildWhereClauseUpdateStatementHelper()protected AbstractContentAssistVisitor.WithinInvalidExpressionVisitorbuildWithinInvalidExpressionVisitor()voiddispose()Disposes of the internal data.protected RangeVariableDeclarationfindRangeVariableDeclaration(UpdateClause expression)Retrieves theRangeVariableDeclarationthat defines the entity name and identification variable for the givenUpdateClause.protected ITypegetAcceptableType(Expression expression)Determines the rootITypethat any type should be assignable.protected AbstractContentAssistVisitor.AppendableExpressionVisitorgetAppendableExpressionVisitor()protected CollectionExpressiongetCollectionExpression(Expression expression)Casts the givenExpressionto aCollectionExpressionif it is actually an object of that type.protected AbstractContentAssistVisitor.CollectionExpressionVisitorgetCollectionExpressionVisitor()Returns the visitor that collects theCollectionExpressionif it's been visited.protected AbstractContentAssistVisitor.ConcatExpressionCollectionHelpergetConcatExpressionCollectionHelper()protected AbstractContentAssistVisitor.ConditionalClauseCollectionHelpergetConditionalClauseCollectionHelper()protected AbstractContentAssistVisitor.ConstrutorCollectionHelpergetConstructorCollectionHelper()protected AbstractContentAssistVisitor.DeclarationVisitorgetDeclarationVisitor()protected AbstractContentAssistVisitor.MappingCollectorgetDefaultMappingCollector()protected AbstractContentAssistVisitor.DeleteClauseCollectionHelpergetDeleteClauseCollectionHelper()protected AbstractContentAssistVisitor.DeleteClauseStatementHelpergetDeleteClauseStatementHelper()protected AbstractContentAssistVisitor.DoubleEncapsulatedCollectionHelpergetDoubleEncapsulatedCollectionHelper()protected AbstractContentAssistVisitor.EncapsulatedExpressionVisitorgetEncapsulatedExpressionVisitor()protected AbstractContentAssistVisitor.EndingQueryPositionBuildergetEndingQueryPositionBuilder()protected AbstractContentAssistVisitor.EnumVisitorgetEnumVisitor()protected ExpressionFactorygetExpressionFactory(java.lang.String expressionFactoryId)Retrieves the registeredExpressionFactorythat was registered for the given unique identifier.protected AbstractContentAssistVisitor.AcceptableTypeVisitorgetExpressionTypeVisitor()protected Filter<Expression>getFilter(java.lang.String identifier)protected AbstractContentAssistVisitor.FollowingClausesVisitorgetFollowingClausesVisitor()protected AbstractContentAssistVisitor.FollowingInvalidExpressionVisitorgetFollowingInvalidExpressionVisitor()protected AbstractContentAssistVisitor.FromClauseCollectionHelpergetFromClauseCollectionHelper()protected AbstractContentAssistVisitor.FromClauseStatementHelpergetFromClauseStatementHelper()protected AbstractContentAssistVisitor.GroupByClauseCollectionHelpergetGroupByClauseCollectionHelper()protected AbstractContentAssistVisitor.GroupByClauseStatementHelpergetGroupByClauseStatementHelper()protected AbstractContentAssistVisitor.HavingClauseStatementHelpergetHavingClauseStatementHelper()protected <T> TgetHelper(java.lang.Class<T> helperClass)Retrieves the helper associated with the given helper class.protected IdentifierRolegetIdentifierRole(java.lang.String identifier)Retrieves the role of the given identifier.protected AbstractContentAssistVisitor.IncompleteCollectionExpressionVisitorgetIncompleteCollectionExpressionVisitor()protected AbstractContentAssistVisitor.InvalidExpressionVisitorgetInvalidExpressionVisitor()protected AbstractContentAssistVisitor.JoinCollectionHelpergetJoinCollectionHelper()protected abstract JPQLGrammargetLatestGrammar()Returns the latest supported JPQL grammar, which is required when checking the validity of a JPQL identifier.protected Filter<IMapping>getMappingCollectionFilter()protected AbstractContentAssistVisitor.MappingFilterBuildergetMappingFilterBuilder()protected Filter<IMapping>getMappingPropertyFilter()protected AbstractContentAssistVisitor.NotExpressionVisitorgetNotExpressionVisitor()protected AbstractContentAssistVisitor.OrderByClauseCollectionHelpergetOrderByClauseCollectionHelper()protected AbstractContentAssistVisitor.OrderByClauseStatementHelpergetOrderByClauseStatementHelper()protected JPQLQueryBNFgetQueryBNF(java.lang.String queryBNFId)Retrieves theJPQLQueryBNFthat was registered for the given unique identifier.protected AbstractContentAssistVisitor.RangeVariableDeclarationVisitorgetRangeVariableDeclarationVisitor()protected AbstractContentAssistVisitor.ResultVariableVisitorgetResultVariableVisitor()protected AbstractContentAssistVisitor.SelectClauseCollectionHelpergetSelectClauseCollectionHelper()protected AbstractContentAssistVisitor.SelectClauseStatementHelpergetSelectClauseStatementHelper()protected AbstractContentAssistVisitor.SimpleFromClauseStatementHelpergetSimpleFromClauseStatementHelper()protected AbstractContentAssistVisitor.SimpleGroupByClauseStatementHelpergetSimpleGroupByClauseStatementHelper()protected AbstractContentAssistVisitor.SimpleHavingClauseStatementHelpergetSimpleHavingClauseStatementHelper()protected AbstractContentAssistVisitor.SimpleSelectClauseCollectionHelpergetSimpleSelectClauseCollectionHelper()protected AbstractContentAssistVisitor.SimpleSelectClauseStatementHelpergetSimpleSelectClauseStatementHelper()protected AbstractContentAssistVisitor.SimpleWhereClauseSelectStatementHelpergetSimpleWhereClauseSelectStatementHelper()protected AbstractContentAssistVisitor.SubqueryAppendableExpressionVisitorgetSubqueryAppendableExpressionVisitor()protected AbstractContentAssistVisitor.SubqueryVisitorgetSubqueryVisitor()protected AbstractContentAssistVisitor.TripleEncapsulatedCollectionHelpergetTripleEncapsulatedCollectionHelper()protected AbstractContentAssistVisitor.UpdateClauseStatementHelpergetUpdateClauseStatementHelper()protected AbstractContentAssistVisitor.UpdateItemCollectionHelpergetUpdateItemCollectionHelper()protected AbstractContentAssistVisitor.VisitParentVisitorgetVisitParentVisitor()protected AbstractContentAssistVisitor.WhenClauseConditionalClauseCollectionHelpergetWhenClauseConditionalClauseCollectionHelper()protected AbstractContentAssistVisitor.WhereClauseDeleteStatementHelpergetWhereClauseDeleteStatementHelper()protected AbstractContentAssistVisitor.WhereClauseSelectStatementHelpergetWhereClauseSelectStatementHelper()protected AbstractContentAssistVisitor.WhereClauseUpdateStatementHelpergetWhereClauseUpdateStatementHelper()protected AbstractContentAssistVisitor.WithinInvalidExpressionVisitorgetWithinInvalidExpressionVisitor()protected booleanhasClausesDefinedBetween(Expression expression, java.lang.String afterIdentifier, java.lang.String beforeIdentifier)protected booleanhasVirtualSpace()Determines whether there is a virtual space to be considered or not.protected voidinitialize()Initializes this visitor.protected booleanisAggregate(java.lang.String identifier)Determines whether the given JPQL identifier used in an aggregate expression; for instance AND.protected booleanisAppendable(Expression expression, AbstractContentAssistVisitor.AppendableType appendableType)Determines whether a certain type of JPQL identifiers can be appended to the JPQL query based on the givenExpression.protected booleanisAppendableToCollection(Expression expression)Determines whetherprotected booleanisClause(java.lang.String identifier)Determines whether the given JPQL identifier used in a clause; for instance SELECT.protected booleanisClauseAppendable(Expression expression)Determines whether the identifiers identifying clauses can be appended to the JPQL query based on the givenExpression.protected booleanisComplete(Expression expression)Determines whether the givenExpressionis grammatically complete.protected booleanisCompoundable(Expression expression)Determines whether the givenExpressioncan be used as the left side of a compound expression.protected booleanisCompoundFunction(java.lang.String identifier)Determines whether the given JPQL identifier used in a compound expression; an example would be BETWEEN or MEMBER.protected booleanisDeclaration(AbstractPathExpression expression)Determines whether the givenAbstractPathExpressionis found within a declaration expression.protected booleanisEncapsulated(Expression expression)Determines whether the givenExpressionis being encapsulated or not.protected booleanisEnumAllowed(AbstractPathExpression expression)Determines whether the givenAbstractPathExpressioncould potentially represent a fully qualified enum constant, which is dictated by the location of the path expression within the query.protected booleanisFollowingInvalidExpression(Expression expression)Determines whether the givenExpressionis preceded by an invalid expression.protected booleanisFunction(java.lang.String identifier)Determines whether the given JPQL identifier is a function, an example would be AVG.protected booleanisInSubquery(Expression expression)Determines whether the givenExpressionis in a subquery or in the top-level query.protected booleanisInvalidExpression(Expression expression)Determines whether the givenExpressionrepresents an invalid fragment.protected abstract booleanisJoinFetchIdentifiable()Determines whether aJOIN FETCHexpression can be identified by with an identification variable or not.protected booleanisLocked(Expression expression)Determines whether the givenExpressionhas been set has the lock to prevent an infinite recursion.protected booleanisNotExpression(Expression expression)Determines whether the givenExpressionrepresents the negated expression.protected booleanisPositionWithin(int position, int offset, java.lang.String word)Determines whether the given position is within the given word.protected booleanisPositionWithin(int position, java.lang.String word)Determines whether the given position is within the given word.protected booleanisSubqueryAppendable(Expression expression)Determines whether the JPQL identifier starting a subquery (SELECT) can be appended based on the givenExpressionwhich is preceding the position of the cursor.protected booleanisValid(Expression expression, java.lang.String queryBNFId)Determines whether the givenExpressionpart is an expression of the given query BNF.protected booleanisValid(Expression expression, JPQLQueryBNF queryBNF)Determines whether the givenExpressionpart is an expression of the given query BNF.protected booleanisValid(JPQLQueryBNF parentQueryBNF, java.lang.String queryBNFId, boolean bypassCompound)Determines whether the givenJPQLQueryBNFpart is the given parentJPQLQueryBNF.protected booleanisValid(JPQLQueryBNF parentQueryBNF, JPQLQueryBNF queryBNF)Determines whether the givenJPQLQueryBNFpart is the given parentJPQLQueryBNF.protected booleanisValid(JPQLQueryBNF parentQueryBNF, JPQLQueryBNF queryBNF, boolean bypassCompound)Determines whether the givenJPQLQueryBNFpart is the given parentJPQLQueryBNF.protected booleanisValidProposal(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.protected booleanisValidVersion(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.protected booleanisWithinInvalidExpression(Expression expression)Determines whether the givenExpressionis part of an invalid fragmentprotected <T> voidregisterHelper(java.lang.Class<T> helperClass, T helper)Registers the given helper associated with the given helper class.protected voidremoveVirtualSpace()Removes the last virtual space from the stack.java.lang.StringtoString()voidvisit(AbsExpression expression)Visits theAbsExpressionexpression.voidvisit(AbstractSchemaName expression)Visits theAbstractSchemaNameexpression.voidvisit(AdditionExpression expression)Visits theAdditionExpressionexpression.voidvisit(AllOrAnyExpression expression)Visits theAllOrAnyExpressionexpression.voidvisit(AndExpression expression)Visits theAndExpressionexpression.voidvisit(ArithmeticFactor expression)Visits theArithmeticFactorexpression.voidvisit(AvgFunction expression)Visits theAvgFunctionexpression.voidvisit(BadExpression expression)Visits theBadExpressionexpression.voidvisit(BetweenExpression expression)Visits theBetweenExpressionexpression.voidvisit(CaseExpression expression)Visits theCaseExpressionexpression.voidvisit(CoalesceExpression expression)Visits theCoalesceExpressionexpression.voidvisit(CollectionExpression expression)Visits theCollectionExpressionexpression.voidvisit(CollectionMemberDeclaration expression)Visits theCollectionMemberDeclarationexpression.voidvisit(CollectionMemberExpression expression)Visits theCollectionMemberExpressionexpression.voidvisit(CollectionValuedPathExpression expression)Visits theCollectionValuedPathExpressionexpression.voidvisit(ComparisonExpression expression)Visits theComparisonExpressionexpression.voidvisit(ConcatExpression expression)Visits theConcatExpressionexpression.voidvisit(ConstructorExpression expression)Visits theConstructorExpressionexpression.voidvisit(CountFunction expression)Visits theCountFunctionexpression.voidvisit(DateTime expression)Visits theDateTimeexpression.voidvisit(DeleteClause expression)Visits theDeleteClauseexpression.voidvisit(DeleteStatement expression)Visits theDeleteStatementexpression.voidvisit(DivisionExpression expression)Visits theDivisionExpressionexpression.voidvisit(EmptyCollectionComparisonExpression expression)Visits theEmptyCollectionComparisonExpressionexpression.voidvisit(EntityTypeLiteral expression)Visits theEntityTypeLiteralexpression.voidvisit(EntryExpression expression)Visits theEntryExpressionexpression.voidvisit(ExistsExpression expression)Visits theExistsExpressionexpression.protected voidvisit(Expression expression)Blindly visit the givenExpression.voidvisit(FromClause expression)Visits theFromClauseexpression.voidvisit(FunctionExpression expression)Visits theFunctionExpressionexpression.voidvisit(GroupByClause expression)Visits theGroupByClauseexpression.voidvisit(HavingClause expression)Visits theHavingClauseexpression.voidvisit(IdentificationVariable expression)Visits theIdentificationVariableexpression.voidvisit(IdentificationVariableDeclaration expression)Visits theIdentificationVariableDeclarationexpression.voidvisit(IndexExpression expression)Visits theIndexExpressionexpression.voidvisit(InExpression expression)Visits theInExpressionexpression.voidvisit(InputParameter expression)Visits theInputParameterexpression.voidvisit(Join expression)Visits theJoinexpression.voidvisit(JPQLExpression expression)Visits theJPQLExpressionexpression.voidvisit(KeyExpression expression)Visits theKeyExpressionexpression.voidvisit(KeywordExpression expression)Visits theKeywordExpressionexpression.voidvisit(LengthExpression expression)Visits theLengthExpressionexpression.voidvisit(LikeExpression expression)Visits theLikeExpressionexpression.voidvisit(LocateExpression expression)Visits theLocateExpressionexpression.voidvisit(LowerExpression expression)Visits theLowerExpressionexpression.voidvisit(MaxFunction expression)Visits theMaxFunctionexpression.voidvisit(MinFunction expression)Visits theMinFunctionexpression.voidvisit(ModExpression expression)Visits theModExpressionexpression.voidvisit(MultiplicationExpression expression)Visits theMultiplicationExpressionexpression.voidvisit(NotExpression expression)Visits theNotExpressionexpression.voidvisit(NullComparisonExpression expression)Visits theNullComparisonExpressionexpression.voidvisit(NullExpression expression)Visits theNullExpressionexpression.voidvisit(NullIfExpression expression)Visits theNullIfExpressionexpression.voidvisit(NumericLiteral expression)Visits theNumericLiteralexpression.voidvisit(ObjectExpression expression)Visits theObjectExpressionexpression.voidvisit(OnClause expression)Visits theOnClauseexpression.voidvisit(OrderByClause expression)Visits theOrderByClauseexpression.voidvisit(OrderByItem expression)Visits theOrderByItemexpression.voidvisit(OrExpression expression)Visits theOrExpressionexpression.voidvisit(RangeVariableDeclaration expression)Visits theRangeVariableDeclarationexpression.voidvisit(ResultVariable expression)Visits theResultVariableexpression.voidvisit(SelectClause expression)Visits theSelectClauseexpression.voidvisit(SelectStatement expression)Visits theSelectStatementexpression.voidvisit(SimpleFromClause expression)Visits theSimpleFromClauseexpression.voidvisit(SimpleSelectClause expression)Visits theSimpleSelectClauseexpression.voidvisit(SimpleSelectStatement expression)Visits theSimpleSelectStatementexpression.voidvisit(SizeExpression expression)Visits theSizeExpressionexpression.voidvisit(SqrtExpression expression)Visits theSqrtExpressionexpression.voidvisit(StateFieldPathExpression expression)Visits theStateFieldPathExpressionexpression.voidvisit(StringLiteral expression)Visits theStringLiteralexpression.voidvisit(SubExpression expression)Visits theSubExpressionexpression.voidvisit(SubstringExpression expression)Visits theSubstringExpressionexpression.voidvisit(SubtractionExpression expression)Visits theSubtractionExpressionexpression.voidvisit(SumFunction expression)Visits theSumFunctionexpression.voidvisit(TreatExpression expression)Visits theTreatExpressionexpression.voidvisit(TrimExpression expression)Visits theTrimExpressionexpression.voidvisit(TypeExpression expression)Visits theTypeExpressionexpression.voidvisit(UnknownExpression expression)Visits theUnknownExpressionexpression.voidvisit(UpdateClause expression)Visits theUpdateClauseexpression.voidvisit(UpdateItem expression)Visits theUpdateItemexpression.voidvisit(UpdateStatement expression)Visits theUpdateStatementexpression.voidvisit(UpperExpression expression)Visits theUpperExpressionexpression.voidvisit(ValueExpression expression)Visits theValueExpressionexpression.voidvisit(WhenClause expression)Visits theWhenClauseexpression.voidvisit(WhereClause expression)Visits theWhereClauseexpression.protected voidvisitAggregateFunction(AggregateFunction expression)Visits the givenAggregateFunctionand attempts to find valid proposals.protected voidvisitArithmeticExpression(ArithmeticExpression expression)Visits the givenArithmeticExpressionand attempts to find valid proposals.protected <T extends Expression>
voidvisitCollectionExpression(T expression, java.lang.String identifier, AbstractContentAssistVisitor.CollectionExpressionHelper<T> helper)Adds the possible proposals for the givenexpressionbased on the location of the cursor and the content of the expression.protected voidvisitEndingExpression(Expression expression)protected voidvisitEnumConstant(AbstractPathExpression expression)protected voidvisitInvalidExpression(Expression expression)protected voidvisitLogicalExpression(LogicalExpression expression)Visits the givenLogicalExpressionand attempts to find valid proposals.protected voidvisitPathExpression(AbstractPathExpression expression)Visits the givenAbstractPathExpressionand attempts to find valid proposals.protected voidvisitPathExpression(AbstractPathExpression expression, Filter<IMapping> filter)Visits the givenAbstractPathExpressionby attempting to resolve the path.protected voidvisitSingleEncapsulatedExpression(AbstractSingleEncapsulatedExpression expression, AbstractContentAssistVisitor.IdentificationVariableType identificationVariableType)Adds the possible proposals for the givenexpressionbased on the location of the cursor and the content of the expression.protected voidvisitSingleEncapsulatedExpression(AbstractSingleEncapsulatedExpression expression, AbstractContentAssistVisitor.IdentificationVariableType identificationVariableType, java.lang.String... expressionIdentifiers)Adds the possible proposals for the givenexpressionbased on the location of the cursor and the content of the expression.protected <T extends Expression>
voidvisitStatement(T expression, AbstractContentAssistVisitor.StatementHelper<T> helper)Visits the givenAbstractSelectStatementand checks to see if the identifiers of the following clauses can be added a valid proposals.protected voidvisitThirdPartyPathExpression(AbstractPathExpression expression, java.lang.String variableName)Visits the givenAbstractPathExpressionand attempts to find valid proposals that is not provided by the default implementation.
-
-
-
Field Detail
-
corrections
protected java.util.Stack<java.lang.Integer> corrections
This is used to change the position of the cursor in order to add possible proposals
-
helpers
protected 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.
-
identifierFilters
protected java.util.Map<java.lang.String,Filter<Expression>> identifierFilters
This map contains theFilterthat is used to determine when an identifier is a valid proposal, some of them depends on the expression's type.
-
lockedExpressions
protected 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.
-
proposals
protected DefaultContentAssistProposals proposals
The set of possible proposals gathered based on the position in the query.
-
queryContext
protected final JPQLQueryContext queryContext
The context used to query information about the JPQL query.
-
queryPosition
protected QueryPosition queryPosition
Contains the position of the cursor within the parsedExpressionfrom the root node up to the deepest leaf node.
-
virtualSpaces
protected java.util.Stack<java.lang.Integer> virtualSpaces
A virtual space is used to move the position of the cursor by adding an extra 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
protected java.lang.String word
The current word, which was retrieved from the JPQL query based on the position of the cursor. The word is the partial string found to the left of the cursor and up to the cursor.
-
wordParser
protected WordParser wordParser
This is used to retrieve words from the actual JPQL query.
-
INVALID_IDENTIFIER_FILTER
protected static final Filter<Expression> INVALID_IDENTIFIER_FILTER
ThisFilteris used to say theExpressionis invalid without doing anything.
-
SPACE_LENGTH
protected static final int SPACE_LENGTH
A constant for the length of a whitespace, which is 1.- See Also:
- Constant Field Values
-
VALID_IDENTIFIER_FILTER
protected static final Filter<Expression> VALID_IDENTIFIER_FILTER
ThisFilteris used to say theExpressionis valid without doing anything.
-
-
Constructor Detail
-
AbstractContentAssistVisitor
protected AbstractContentAssistVisitor(JPQLQueryContext queryContext)
Creates a newAbstractContentAssistVisitor.- Parameters:
queryContext- The context used to query information about the JPQL query- Throws:
java.lang.NullPointerException- TheJPQLQueryContextcannot benull
-
-
Method Detail
-
addAggregateIdentifier
protected void addAggregateIdentifier(java.lang.String identifier)
Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.AGGREGATEand the beginning starts with the current word.- Parameters:
identifier- The JPQL identifier to add as a valid proposal if it passes the checks
-
addAggregateIdentifiers
protected void addAggregateIdentifiers(JPQLQueryBNF queryBNF)
Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.AGGREGATEand the beginning starts with the current word.- Parameters:
queryBNF- TheJPQLQueryBNFfor which the registered JPQL identifiers will be added as proposals if they pass the checks
-
addAggregateIdentifiers
protected void addAggregateIdentifiers(java.lang.String queryBNFId)
Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.AGGREGATEand the beginning starts with the current word.- Parameters:
queryBNFId- The unique of theJPQLQueryBNFfor which the registered JPQL identifiers will be added as proposals if they pass the checks
-
addArithmeticIdentifiers
protected void addArithmeticIdentifiers()
Adds the JPQL identifiers which correspond to the arithmetic operators as valid proposals. The word has to be an empty string.
-
addClauseIdentifier
protected void addClauseIdentifier(java.lang.String identifier)
Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.CLAUSEand the beginning starts with the current word.- Parameters:
identifier- The JPQL identifier to add as a valid proposal if it passes the checks
-
addClauseIdentifiers
protected void addClauseIdentifiers(JPQLQueryBNF queryBNF)
Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.CLAUSEand the beginning starts with the current word.- Parameters:
queryBNF- TheJPQLQueryBNFfor which the registered JPQL identifiers will be added as proposals if they pass the checks
-
addClauseIdentifiers
protected void addClauseIdentifiers(java.lang.String queryBNFId)
Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.CLAUSEand the beginning starts with the current word.- Parameters:
queryBNFId- The unique identifier of theJPQLQueryBNFfor which the registered JPQL identifiers will be added as proposals if they pass the checks
-
addComparisonIdentifiers
protected void addComparisonIdentifiers(Expression expression)
Adds the JPQL identifiers which correspond to the comparison operators as valid proposals. The word has to be an empty string.- Parameters:
expression- TheExpressionis preceding the position of the cursor and will help to determine which of the comparison operators are valid
-
addCompositeIdentifier
protected void addCompositeIdentifier(java.lang.String identifier, int offset)Adds the composite JPQL identifier by following the given rules:- If the word is empty and the offset is -1, then use the rule used by
addIdentifier(String); - Otherwise checks the ending of the JPQL query with a portion of the identifier from the entire length of the identifier to the given offset by cutting off the trailing characters.
- Parameters:
identifier- The composite JPQL identifier to add as valid proposal. The composite part means it is an identifier composed of more than one word, example:GROUP BYoffset- The smallest length of the given identifier to test against the ending of the JPQL query based on the position of the cursor. The offset is exclusive
- If the word is empty and the offset is -1, then use the rule used by
-
addCompoundIdentifier
protected void addCompoundIdentifier(java.lang.String identifier, Expression expression, boolean hasIs, boolean hasNot)Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.COMPOUND_FUNCTIONand the beginning starts with the current word.- Parameters:
identifier- The JPQL identifier to add as a valid proposal if it passes the checksexpression- TheExpressionrepresents the fragment that is before the current word and it helps to filter out some of the compound identifiershasIs- Flag indicating if theISidentifier was found before the word, which would also be before theNOTidentifier if it was also foundhasNot- Flag indicating if theNOTidentifier was found before the word
-
addCompoundIdentifiers
protected void addCompoundIdentifiers(JPQLQueryBNF queryBNF, Expression expression, boolean hasIs, boolean hasNot)
Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.COMPOUND_FUNCTIONand the beginning starts with the current word.- Parameters:
queryBNF- TheJPQLQueryBNFfor which the registered JPQL identifiers will be added as proposals if they pass the checksexpression- TheExpressionrepresents the fragment that is before the current word and it helps to filter out some of the compound identifiershasIs- Flag indicating if theISidentifier was found before the word, which would also be before theNOTidentifier if it was also foundhasNot- Flag indicating if theNOTidentifier was found before the word
-
addCompoundIdentifiers
protected void addCompoundIdentifiers(java.lang.String queryBNFId, Expression expression, boolean hasIs, boolean hasNot)Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.COMPOUND_FUNCTIONand the beginning starts with the current word.- Parameters:
queryBNFId- The unique identifier of theJPQLQueryBNFfor which the registered JPQL identifiers will be added as proposals if they pass the checksexpression- TheExpressionrepresents the fragment that is before the current word and it helps to filter out some of the compound identifiershasIs- Flag indicating if theISidentifier was found before the word, which would also be before theNOTidentifier if it was also foundhasNot- Flag indicating if theNOTidentifier was found before the word
-
addEntities
protected void addEntities()
Adds the entities as possible content assist proposals but will be filtered using the current word.
-
addEntities
protected void addEntities(IType type)
Adds the entities as possible content assist proposals but will be filtered using the current word and the entity's type will have to be assignable from the givenIType.- Parameters:
type- TheITypeused to filter the abstract schema types
-
addEnumConstant
protected void addEnumConstant(IType enumType, java.lang.String enumConstant)
Adds the given enum constant as a valid proposal.- Parameters:
enumType- TheITypeof theEnumenumConstant- The enum constant to be added as a valid proposal
-
addEnumConstants
protected void addEnumConstants(IType enumType, java.lang.String word)
Adds the constants of the given enum type as valid proposals if the beginning starts with the given word.- Parameters:
enumType- TheITypeof the enum typeword- The word is used to filter the enum constants, which can benullor an empty string
-
addExpressionFactoryIdentifiers
protected void addExpressionFactoryIdentifiers(ExpressionFactory expressionFactory)
Adds the JPQL identifiers that were registered with the givenExpressionFactory.- Parameters:
expressionFactory- The factory for which its registered JPQL identifiers are added as valid proposals, if they meet the checks
-
addExpressionFactoryIdentifiers
protected void addExpressionFactoryIdentifiers(java.lang.String expressionFactoryId)
Adds the JPQL identifiers that were registered with theExpressionFactorywith the given unique identifier.- Parameters:
expressionFactoryId- The unique identifier of the factory for which its registered JPQL identifiers are added as valid proposals, if they meet the checks
-
addFunctionIdentifier
protected void addFunctionIdentifier(java.lang.String identifier)
Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.FUNCTIONand the beginning starts with the current word.- Parameters:
identifier- The JPQL identifier to add as a valid proposal if it passes the checks
-
addFunctionIdentifiers
protected void addFunctionIdentifiers(Expression expression)
Adds the JPQL identifiers for which their role isFUNCTIONby determining theJPQLQueryBNFthat represents the fragment for which the givenExpressionwas parsed.For instance: "
SELECT e, AVG(e.name) FROM Employee e" and the given expression is "AVG(e.name)", then the BNF should be the select item BNF.If the BNF allows for a subquery and the expression is encapsulated by parenthesis, then
SELECTwill also be added.The identification variables will also be added.
- Parameters:
expression- TheExpressionis used to determine theJPQLQueryBNFto use when retrieving the JPQL identifiers representing a function
-
addFunctionIdentifiers
protected void addFunctionIdentifiers(JPQLQueryBNF queryBNF)
Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.FUNCTIONand the beginning starts with the current word.- Parameters:
queryBNF- TheJPQLQueryBNFfor which the registered JPQL identifiers will be added as proposals if they pass the checks
-
addFunctionIdentifiers
protected void addFunctionIdentifiers(java.lang.String queryBNFId)
Adds the JPQL identifiers that are registered with the givenJPQLQueryBNFas valid proposals if their role isIdentifierRole.FUNCTIONand the beginning starts with the current word.- Parameters:
queryBNFId- The unique identifier of theJPQLQueryBNFfor which the registered JPQL identifiers will be added as proposals if they pass the checks
-
addIdentificationVariable
protected void addIdentificationVariable(java.lang.String identificationVariable)
Adds the given identification variable as a valid proposal.- Parameters:
identificationVariable- The identification variable to add as a proposal if it passes the checks
-
addIdentificationVariables
protected void addIdentificationVariables()
Adds all the identification variables defined in the current query's FROM clause.
-
addIdentificationVariables
protected void addIdentificationVariables(Expression expression, AbstractContentAssistVisitor.IdentificationVariableType type)
Adds the possible identification variables as valid proposals but filter them based on the given type.For instance, if the type is
AbstractContentAssistVisitor.IdentificationVariableType.LEFT, then any identification variables that have been defined before the givenExpressionare valid proposals, but those defined after are not valid proposals.- Parameters:
expression- TheExpressionwhere the content assist was invoked, which helps to determine how to stop adding identification variablestype- Which type of identification variables to add as valid proposals
-
addIdentifier
protected void addIdentifier(java.lang.String identifier)
Adds the given identifier as a proposal if it passes the checks.- Parameters:
identifier- The JPQL identifier to add as a proposal
-
addJoinIdentifiers
protected void addJoinIdentifiers()
Adds the join specification identifiers as proposals.
-
addLeftIdentificationVariables
protected void addLeftIdentificationVariables(Expression expression)
Adds the identification variables defined in the current query's FROM clause that are declared before the givenExpression.- Parameters:
expression- TheExpressionused to determine at which declaration to stop
-
addLogicalIdentifiers
protected void addLogicalIdentifiers()
Adds the logical identifiers, which areANDandOR.
-
addRangeIdentificationVariable
protected void addRangeIdentificationVariable(java.lang.String identificationVariable)
Adds the given identification variable as a proposal if it passes the checks. If an entity is found, then it will be registered.- Parameters:
identificationVariable- An identification variable that is
-
addResultVariables
protected void addResultVariables()
Adds the result variables defined in theSELECTclause as valid proposals.
-
addVirtualSpace
protected final void addVirtualSpace()
Adds a virtual space on the stack.
-
areArithmeticSymbolsAppendable
protected boolean areArithmeticSymbolsAppendable(Expression expression)
Determines whether the givenExpressioncan be followed by an arithmetic operator.- Parameters:
expression- TheExpressionthat found left of the cursor, which determines if the arithmetic operators are appendable or not- Returns:
trueif the operators are appendable;falseotherwise
-
areComparisonSymbolsAppendable
protected boolean areComparisonSymbolsAppendable(Expression expression)
Determines whether the givenExpressioncan be followed by a comparison operator.- Parameters:
expression- TheExpressionthat found left of the cursor, which determines if the comparison operators are appendable or not- Returns:
trueif the operators are appendable;falseotherwise
-
areLogicalSymbolsAppendable
protected boolean areLogicalSymbolsAppendable(Expression expression)
Determines whether the givenExpressioncan be followed by a logical operator.- Parameters:
expression- TheExpressionthat found left of the cursor, which determines if the logical operators are appendable or not- Returns:
trueif the logical identifiers are appendable;falseotherwise
-
buildAcceptableTypeVisitor
protected abstract AbstractContentAssistVisitor.AcceptableTypeVisitor buildAcceptableTypeVisitor()
-
buildAppendableExpressionVisitor
protected AbstractContentAssistVisitor.AppendableExpressionVisitor buildAppendableExpressionVisitor()
-
buildCollectionCompoundTypeFilter
protected Filter<Expression> buildCollectionCompoundTypeFilter()
-
buildCollectionExpressionVisitor
protected AbstractContentAssistVisitor.CollectionExpressionVisitor buildCollectionExpressionVisitor()
-
buildCollectionMappingFilter
protected AbstractContentAssistVisitor.CollectionMappingFilter buildCollectionMappingFilter()
-
buildConcatExpressionCollectionHelper
protected AbstractContentAssistVisitor.ConcatExpressionCollectionHelper buildConcatExpressionCollectionHelper()
-
buildConditionalClauseCollectionHelper
protected AbstractContentAssistVisitor.ConditionalClauseCollectionHelper buildConditionalClauseCollectionHelper()
-
buildConstrutorCollectionHelper
protected AbstractContentAssistVisitor.ConstrutorCollectionHelper buildConstrutorCollectionHelper()
-
buildDeclarationVisitor
protected AbstractContentAssistVisitor.DeclarationVisitor buildDeclarationVisitor()
-
buildDefaultMappingCollector
protected AbstractContentAssistVisitor.DefaultMappingCollector buildDefaultMappingCollector()
-
buildDeleteClauseCollectionHelper
protected AbstractContentAssistVisitor.DeleteClauseCollectionHelper buildDeleteClauseCollectionHelper()
-
buildDeleteClauseStatementHelper
protected AbstractContentAssistVisitor.DeleteClauseStatementHelper buildDeleteClauseStatementHelper()
-
buildDifferentComparisonFilter
protected Filter<Expression> buildDifferentComparisonFilter()
-
buildDoubleEncapsulatedCollectionHelper
protected AbstractContentAssistVisitor.DoubleEncapsulatedCollectionHelper buildDoubleEncapsulatedCollectionHelper()
-
buildEncapsulatedExpressionVisitor
protected AbstractContentAssistVisitor.EncapsulatedExpressionVisitor buildEncapsulatedExpressionVisitor()
-
buildEndingPositionFromInvalidExpression
protected QueryPosition buildEndingPositionFromInvalidExpression(Expression invalidExpression, Expression startingPointExpression, boolean[] virtualSpace)
Creates a newQueryPositioncontaining the corrected positions starting at the givenExpressionand traversing the children at is always at the right side of the tree.- Parameters:
invalidExpression- The invalidExpressionfor which a newQueryPositionwill be calculatedstartingPointExpression- TheExpressionfrom which the calculation of the positions will startvirtualSpace- Single element array that will be used to store the flag indicating if a virtual space should be added or not- Returns:
- The new
QueryPositionthat contains the position of the cursor starting from the givenExpressiondown to the right leaf
-
buildEndingQueryPositionBuilder
protected AbstractContentAssistVisitor.EndingQueryPositionBuilder buildEndingQueryPositionBuilder()
-
buildEnumVisitor
protected AbstractContentAssistVisitor.EnumVisitor buildEnumVisitor()
-
buildFilteringMappingCollector
protected AbstractContentAssistVisitor.FilteringMappingCollector buildFilteringMappingCollector(AbstractPathExpression expression, Resolver resolver, Filter<IMapping> filter, java.lang.String pattern)
-
buildFollowingClausesVisitor
protected AbstractContentAssistVisitor.FollowingClausesVisitor buildFollowingClausesVisitor()
-
buildFollowingInvalidExpressionVisitor
protected AbstractContentAssistVisitor.FollowingInvalidExpressionVisitor buildFollowingInvalidExpressionVisitor()
-
buildFromClauseCollectionHelper
protected AbstractContentAssistVisitor.FromClauseCollectionHelper buildFromClauseCollectionHelper()
-
buildFromClauseStatementHelper
protected AbstractContentAssistVisitor.FromClauseStatementHelper buildFromClauseStatementHelper()
-
buildGroupByClauseCollectionHelper
protected AbstractContentAssistVisitor.GroupByClauseCollectionHelper buildGroupByClauseCollectionHelper()
-
buildGroupByClauseStatementHelper
protected AbstractContentAssistVisitor.GroupByClauseStatementHelper buildGroupByClauseStatementHelper()
-
buildHavingClauseStatementHelper
protected AbstractContentAssistVisitor.HavingClauseStatementHelper buildHavingClauseStatementHelper()
-
buildIncompleteCollectionExpressionVisitor
protected AbstractContentAssistVisitor.IncompleteCollectionExpressionVisitor buildIncompleteCollectionExpressionVisitor()
-
buildInvalidExpressionVisitor
protected AbstractContentAssistVisitor.InvalidExpressionVisitor buildInvalidExpressionVisitor()
-
buildJoinCollectionHelper
protected AbstractContentAssistVisitor.JoinCollectionHelper buildJoinCollectionHelper()
-
buildJPQLQueryBNFValidator
protected AbstractValidator.JPQLQueryBNFValidator buildJPQLQueryBNFValidator(JPQLQueryBNF queryBNF)
Returns theAbstractValidator.JPQLQueryBNFValidatorthat can be used to validate anExpressionby making sure its BNF is part of the given BNF.- Parameters:
queryBNF- The BNF used to determine the validity of anExpression- Returns:
- A
AbstractValidator.JPQLQueryBNFValidatorthat can determine if anExpressionfollows the given BNF
-
buildMappingCollector
protected AbstractContentAssistVisitor.MappingCollector buildMappingCollector(AbstractPathExpression expression, Resolver resolver, Filter<IMapping> filter)
-
buildMappingFilter
protected Filter<IMapping> buildMappingFilter(AbstractPathExpression expression, Filter<IMapping> filter)
-
buildMappingFilter
protected Filter<IMapping> buildMappingFilter(Expression expression)
-
buildMappingFilterBuilder
protected AbstractContentAssistVisitor.MappingFilterBuilder buildMappingFilterBuilder()
-
buildNonCollectionCompoundTypeFilter
protected Filter<Expression> buildNonCollectionCompoundTypeFilter()
-
buildNotExpressionVisitor
protected AbstractContentAssistVisitor.NotExpressionVisitor buildNotExpressionVisitor()
-
buildOrderByClauseCollectionHelper
protected AbstractContentAssistVisitor.OrderByClauseCollectionHelper buildOrderByClauseCollectionHelper()
-
buildOrderByClauseStatementHelper
protected AbstractContentAssistVisitor.OrderByClauseStatementHelper buildOrderByClauseStatementHelper()
-
buildPropertyMappingFilter
protected AbstractContentAssistVisitor.PropertyMappingFilter buildPropertyMappingFilter()
-
buildProposals
public ContentAssistProposals buildProposals(int position)
Prepares this visitor by prepopulating it with the necessary data that is required to properly gather the list of proposals based on the given caret position.- Parameters:
position- The position of the cursor within the JPQL query- Returns:
- The proposals that are valid choices for the given position
-
buildProposals
public ContentAssistProposals buildProposals(int position, ContentAssistExtension extension)
Prepares this visitor by prepopulating it with the necessary data that is required to properly gather the list of proposals based on the given caret position.- Parameters:
position- The position of the cursor within the JPQL queryextension- This extension can be used to provide additional support to JPQL content assist that is outside the scope of providing proposals related to JPA metadata. It adds support for providing suggestions related to class names, enum constants, table names, column names- Returns:
- The proposals that are valid choices for the given position
-
buildRangeVariableDeclarationVisitor
protected AbstractContentAssistVisitor.RangeVariableDeclarationVisitor buildRangeVariableDeclarationVisitor()
-
buildResultVariableVisitor
protected AbstractContentAssistVisitor.ResultVariableVisitor buildResultVariableVisitor()
-
buildSelectClauseCollectionHelper
protected AbstractContentAssistVisitor.SelectClauseCollectionHelper buildSelectClauseCollectionHelper()
-
buildSelectClauseStatementHelper
protected AbstractContentAssistVisitor.SelectClauseStatementHelper buildSelectClauseStatementHelper()
-
buildSimpleFromClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleFromClauseStatementHelper buildSimpleFromClauseStatementHelper()
-
buildSimpleGroupByClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleGroupByClauseStatementHelper buildSimpleGroupByClauseStatementHelper()
-
buildSimpleHavingClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleHavingClauseStatementHelper buildSimpleHavingClauseStatementHelper()
-
buildSimpleSelectClauseCollectionHelper
protected AbstractContentAssistVisitor.SimpleSelectClauseCollectionHelper buildSimpleSelectClauseCollectionHelper()
-
buildSimpleSelectClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleSelectClauseStatementHelper buildSimpleSelectClauseStatementHelper()
-
buildSimpleWhereClauseSelectStatementHelper
protected AbstractContentAssistVisitor.SimpleWhereClauseSelectStatementHelper buildSimpleWhereClauseSelectStatementHelper()
-
buildSubqueryAppendableExpressionVisitor
protected AbstractContentAssistVisitor.SubqueryAppendableExpressionVisitor buildSubqueryAppendableExpressionVisitor()
-
buildSubqueryVisitor
protected AbstractContentAssistVisitor.SubqueryVisitor buildSubqueryVisitor()
-
buildTripleEncapsulatedCollectionHelper
protected AbstractContentAssistVisitor.TripleEncapsulatedCollectionHelper buildTripleEncapsulatedCollectionHelper()
-
buildUpdateClauseStatementHelper
protected AbstractContentAssistVisitor.UpdateClauseStatementHelper buildUpdateClauseStatementHelper()
-
buildUpdateItemCollectionHelper
protected AbstractContentAssistVisitor.UpdateItemCollectionHelper buildUpdateItemCollectionHelper()
-
buildVisitParentVisitor
protected AbstractContentAssistVisitor.VisitParentVisitor buildVisitParentVisitor()
-
buildWhenClauseConditionalClauseCollectionHelper
protected AbstractContentAssistVisitor.WhenClauseConditionalClauseCollectionHelper buildWhenClauseConditionalClauseCollectionHelper()
-
buildWhereClauseDeleteStatementHelper
protected AbstractContentAssistVisitor.WhereClauseDeleteStatementHelper buildWhereClauseDeleteStatementHelper()
-
buildWhereClauseSelectStatementHelper
protected AbstractContentAssistVisitor.WhereClauseSelectStatementHelper buildWhereClauseSelectStatementHelper()
-
buildWhereClauseUpdateStatementHelper
protected AbstractContentAssistVisitor.WhereClauseUpdateStatementHelper buildWhereClauseUpdateStatementHelper()
-
buildWithinInvalidExpressionVisitor
protected AbstractContentAssistVisitor.WithinInvalidExpressionVisitor buildWithinInvalidExpressionVisitor()
-
dispose
public void dispose()
Disposes of the internal data.
-
findRangeVariableDeclaration
protected RangeVariableDeclaration findRangeVariableDeclaration(UpdateClause expression)
Retrieves theRangeVariableDeclarationthat defines the entity name and identification variable for the givenUpdateClause.- Returns:
- Either the
RangeVariableDeclarationif the JPQL query defines it ornullif it was not defined
-
getAcceptableType
protected IType getAcceptableType(Expression expression)
Determines the rootITypethat any type should be assignable. If theITypeisNumber, than any subclasses will be allowed.- Parameters:
expression- TheExpressionto visit, including its parent hierarchy until anExpressionrequires a certainIType- Returns:
- The root
ITypeallowed ornullif anything is allowed
-
getAppendableExpressionVisitor
protected AbstractContentAssistVisitor.AppendableExpressionVisitor getAppendableExpressionVisitor()
-
getCollectionExpression
protected CollectionExpression getCollectionExpression(Expression expression)
Casts the givenExpressionto aCollectionExpressionif it is actually an object of that type.- Parameters:
expression- TheExpressionto cast- Returns:
- The given
Expressionif it is aCollectionExpressionornullif it is any other object
-
getCollectionExpressionVisitor
protected AbstractContentAssistVisitor.CollectionExpressionVisitor getCollectionExpressionVisitor()
Returns the visitor that collects theCollectionExpressionif it's been visited.- Returns:
- The
AbstractContentAssistVisitor.CollectionExpressionVisitor - See Also:
buildCollectionExpressionVisitor()
-
getConcatExpressionCollectionHelper
protected AbstractContentAssistVisitor.ConcatExpressionCollectionHelper getConcatExpressionCollectionHelper()
-
getConditionalClauseCollectionHelper
protected AbstractContentAssistVisitor.ConditionalClauseCollectionHelper getConditionalClauseCollectionHelper()
-
getConstructorCollectionHelper
protected AbstractContentAssistVisitor.ConstrutorCollectionHelper getConstructorCollectionHelper()
-
getDeclarationVisitor
protected AbstractContentAssistVisitor.DeclarationVisitor getDeclarationVisitor()
-
getDefaultMappingCollector
protected AbstractContentAssistVisitor.MappingCollector getDefaultMappingCollector()
-
getDeleteClauseCollectionHelper
protected AbstractContentAssistVisitor.DeleteClauseCollectionHelper getDeleteClauseCollectionHelper()
-
getDeleteClauseStatementHelper
protected AbstractContentAssistVisitor.DeleteClauseStatementHelper getDeleteClauseStatementHelper()
-
getDoubleEncapsulatedCollectionHelper
protected AbstractContentAssistVisitor.DoubleEncapsulatedCollectionHelper getDoubleEncapsulatedCollectionHelper()
-
getEncapsulatedExpressionVisitor
protected AbstractContentAssistVisitor.EncapsulatedExpressionVisitor getEncapsulatedExpressionVisitor()
-
getEndingQueryPositionBuilder
protected AbstractContentAssistVisitor.EndingQueryPositionBuilder getEndingQueryPositionBuilder()
-
getEnumVisitor
protected AbstractContentAssistVisitor.EnumVisitor getEnumVisitor()
-
getExpressionFactory
protected ExpressionFactory getExpressionFactory(java.lang.String expressionFactoryId)
Retrieves the registeredExpressionFactorythat was registered for the given unique identifier.- Parameters:
expressionFactoryId- The unique identifier of theExpressionFactoryto retrieve- Returns:
- The
ExpressionFactorymapped with the given unique identifier
-
getExpressionTypeVisitor
protected AbstractContentAssistVisitor.AcceptableTypeVisitor getExpressionTypeVisitor()
-
getFilter
protected Filter<Expression> getFilter(java.lang.String identifier)
-
getFollowingClausesVisitor
protected AbstractContentAssistVisitor.FollowingClausesVisitor getFollowingClausesVisitor()
-
getFollowingInvalidExpressionVisitor
protected AbstractContentAssistVisitor.FollowingInvalidExpressionVisitor getFollowingInvalidExpressionVisitor()
-
getFromClauseCollectionHelper
protected AbstractContentAssistVisitor.FromClauseCollectionHelper getFromClauseCollectionHelper()
-
getFromClauseStatementHelper
protected AbstractContentAssistVisitor.FromClauseStatementHelper getFromClauseStatementHelper()
-
getGroupByClauseCollectionHelper
protected AbstractContentAssistVisitor.GroupByClauseCollectionHelper getGroupByClauseCollectionHelper()
-
getGroupByClauseStatementHelper
protected AbstractContentAssistVisitor.GroupByClauseStatementHelper getGroupByClauseStatementHelper()
-
getHavingClauseStatementHelper
protected AbstractContentAssistVisitor.HavingClauseStatementHelper getHavingClauseStatementHelper()
-
getHelper
protected final <T> T getHelper(java.lang.Class<T> helperClass)
Retrieves the helper associated with the given helper class.- Parameters:
helperClass- The Java class of the helper to retrieve- Returns:
- The helper being requested
-
getIdentifierRole
protected IdentifierRole getIdentifierRole(java.lang.String identifier)
Retrieves the role of the given identifier. A role helps to describe the purpose of the identifier in a query.- Parameters:
identifier- The identifier for which its role is requested- Returns:
- The role of the given identifier
-
getIncompleteCollectionExpressionVisitor
protected AbstractContentAssistVisitor.IncompleteCollectionExpressionVisitor getIncompleteCollectionExpressionVisitor()
-
getInvalidExpressionVisitor
protected AbstractContentAssistVisitor.InvalidExpressionVisitor getInvalidExpressionVisitor()
-
getJoinCollectionHelper
protected AbstractContentAssistVisitor.JoinCollectionHelper getJoinCollectionHelper()
-
getLatestGrammar
protected abstract JPQLGrammar getLatestGrammar()
Returns the latest supported JPQL grammar, which is required when checking the validity of a JPQL identifier. This is due to the fact that any JPQL identifiers defined in a more recent spec will be seen to be registered in version 1.0 of the spec. By returning the latest version, any JPQL identifiers should have a version registered.- Returns:
- The latest
JPQLGrammarsupported by the provider
-
getMappingFilterBuilder
protected AbstractContentAssistVisitor.MappingFilterBuilder getMappingFilterBuilder()
-
getNotExpressionVisitor
protected AbstractContentAssistVisitor.NotExpressionVisitor getNotExpressionVisitor()
-
getOrderByClauseCollectionHelper
protected AbstractContentAssistVisitor.OrderByClauseCollectionHelper getOrderByClauseCollectionHelper()
-
getOrderByClauseStatementHelper
protected AbstractContentAssistVisitor.OrderByClauseStatementHelper getOrderByClauseStatementHelper()
-
getQueryBNF
protected JPQLQueryBNF getQueryBNF(java.lang.String queryBNFId)
Retrieves theJPQLQueryBNFthat was registered for the given unique identifier.- Parameters:
queryBNFId- The unique identifier of theJPQLQueryBNFto retrieve- Returns:
- The
JPQLQueryBNFrepresenting a section of the grammar
-
getRangeVariableDeclarationVisitor
protected AbstractContentAssistVisitor.RangeVariableDeclarationVisitor getRangeVariableDeclarationVisitor()
-
getResultVariableVisitor
protected AbstractContentAssistVisitor.ResultVariableVisitor getResultVariableVisitor()
-
getSelectClauseCollectionHelper
protected AbstractContentAssistVisitor.SelectClauseCollectionHelper getSelectClauseCollectionHelper()
-
getSelectClauseStatementHelper
protected AbstractContentAssistVisitor.SelectClauseStatementHelper getSelectClauseStatementHelper()
-
getSimpleFromClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleFromClauseStatementHelper getSimpleFromClauseStatementHelper()
-
getSimpleGroupByClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleGroupByClauseStatementHelper getSimpleGroupByClauseStatementHelper()
-
getSimpleHavingClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleHavingClauseStatementHelper getSimpleHavingClauseStatementHelper()
-
getSimpleSelectClauseCollectionHelper
protected AbstractContentAssistVisitor.SimpleSelectClauseCollectionHelper getSimpleSelectClauseCollectionHelper()
-
getSimpleSelectClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleSelectClauseStatementHelper getSimpleSelectClauseStatementHelper()
-
getSimpleWhereClauseSelectStatementHelper
protected AbstractContentAssistVisitor.SimpleWhereClauseSelectStatementHelper getSimpleWhereClauseSelectStatementHelper()
-
getSubqueryAppendableExpressionVisitor
protected AbstractContentAssistVisitor.SubqueryAppendableExpressionVisitor getSubqueryAppendableExpressionVisitor()
-
getSubqueryVisitor
protected AbstractContentAssistVisitor.SubqueryVisitor getSubqueryVisitor()
-
getTripleEncapsulatedCollectionHelper
protected AbstractContentAssistVisitor.TripleEncapsulatedCollectionHelper getTripleEncapsulatedCollectionHelper()
-
getUpdateClauseStatementHelper
protected AbstractContentAssistVisitor.UpdateClauseStatementHelper getUpdateClauseStatementHelper()
-
getUpdateItemCollectionHelper
protected AbstractContentAssistVisitor.UpdateItemCollectionHelper getUpdateItemCollectionHelper()
-
getVisitParentVisitor
protected AbstractContentAssistVisitor.VisitParentVisitor getVisitParentVisitor()
-
getWhenClauseConditionalClauseCollectionHelper
protected AbstractContentAssistVisitor.WhenClauseConditionalClauseCollectionHelper getWhenClauseConditionalClauseCollectionHelper()
-
getWhereClauseDeleteStatementHelper
protected AbstractContentAssistVisitor.WhereClauseDeleteStatementHelper getWhereClauseDeleteStatementHelper()
-
getWhereClauseSelectStatementHelper
protected AbstractContentAssistVisitor.WhereClauseSelectStatementHelper getWhereClauseSelectStatementHelper()
-
getWhereClauseUpdateStatementHelper
protected AbstractContentAssistVisitor.WhereClauseUpdateStatementHelper getWhereClauseUpdateStatementHelper()
-
getWithinInvalidExpressionVisitor
protected AbstractContentAssistVisitor.WithinInvalidExpressionVisitor getWithinInvalidExpressionVisitor()
-
hasClausesDefinedBetween
protected boolean hasClausesDefinedBetween(Expression expression, java.lang.String afterIdentifier, java.lang.String beforeIdentifier)
-
hasVirtualSpace
protected final boolean hasVirtualSpace()
Determines whether there is a virtual space to be considered or not.- Returns:
trueif there is a virtual space to count as a real one or not
-
initialize
protected void initialize()
Initializes this visitor.
-
isAggregate
protected boolean isAggregate(java.lang.String identifier)
Determines whether the given JPQL identifier used in an aggregate expression; for instance AND.- Parameters:
identifier- The identifier to validate- Returns:
trueif the given identifier is used in an aggregate expression;falseotherwise
-
isAppendable
protected boolean isAppendable(Expression expression, AbstractContentAssistVisitor.AppendableType appendableType)
Determines whether a certain type of JPQL identifiers can be appended to the JPQL query based on the givenExpression.- Parameters:
expression- TheExpressionthat determines what can be appendedappendableType- The type of identifiers to append to the JPQL query- Returns:
trueif the JPQL identifiers with the given type can be appended to the JPQL query;falseif they cannot
-
isAppendableToCollection
protected boolean isAppendableToCollection(Expression expression)
Determines whether- Parameters:
expression-- Returns:
-
isClause
protected 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:
trueif the given identifier is a clause;falseotherwise
-
isClauseAppendable
protected boolean isClauseAppendable(Expression expression)
Determines whether the identifiers identifying clauses can be appended to the JPQL query based on the givenExpression.- Parameters:
expression- TheExpressionthat determines what can be appended- Returns:
trueif the following clauses can be appended to the JPQL query;falseif they cannot
-
isComplete
protected boolean isComplete(Expression expression)
Determines whether the givenExpressionis grammatically complete.- Parameters:
expression- TheExpressionto verify its grammar integrity- Returns:
trueif theExpressionis grammatically complete;falseotherwise
-
isCompoundable
protected boolean isCompoundable(Expression expression)
Determines whether the givenExpressioncan be used as the left side of a compound expression.- Parameters:
expression- TheExpressionthat determines if the JPQL identifiers withIdentifierRole.COMPOUND_FUNCTIONcan be used to create a compound expression- Returns:
trueif the compound identifiers can be appended to the JPQL query;falseif they cannot
-
isCompoundFunction
protected 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:
trueif the given identifier is used in a compound expression;falseotherwise
-
isDeclaration
protected boolean isDeclaration(AbstractPathExpression expression)
Determines whether the givenAbstractPathExpressionis found within a declaration expression.- Parameters:
expression- TheAbstractPathExpressionto visit- Returns:
trueif the visitedCollectionValuedPathExpressionis owned by aRangeVariableDeclaration, which indicates it is used to define the "root" object;falseif it is not
-
isEncapsulated
protected boolean isEncapsulated(Expression expression)
Determines whether the givenExpressionis being encapsulated or not.- Parameters:
expression- TheExpressionto scan for encapsulation- Returns:
trueif the givenExpressionis within parenthesis;falseotherwise
-
isEnumAllowed
protected boolean isEnumAllowed(AbstractPathExpression expression)
Determines whether the givenAbstractPathExpressioncould potentially represent a fully qualified enum constant, which is dictated by the location of the path expression within the query. Only a few location allows an enum constant.- Parameters:
expression- TheAbstractPathExpressionto visit- Returns:
trueif the path expression represents a enum constant;falseotherwise
-
isFollowingInvalidExpression
protected boolean isFollowingInvalidExpression(Expression expression)
Determines whether the givenExpressionis preceded by an invalid expression.- Parameters:
expression- TheExpressionto visit- Returns:
trueif the visitedExpressionis part of a collection of expressions and an invalid expression precede it;falseotherwise
-
isFunction
protected 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:
trueif the given identifier is a function;falseotherwise
-
isInSubquery
protected boolean isInSubquery(Expression expression)
Determines whether the givenExpressionis in a subquery or in the top-level query.- Parameters:
expression- TheExpressionto visit its parent hierarchy- Returns:
trueif the owning query is a subquery;falseif it's the top-level query
-
isInvalidExpression
protected boolean isInvalidExpression(Expression expression)
Determines whether the givenExpressionrepresents an invalid fragment.- Parameters:
expression- TheExpressionto visit- Returns:
trueif theExpressionis an invalid fragment;falseotherwise
-
isJoinFetchIdentifiable
protected abstract boolean isJoinFetchIdentifiable()
Determines whether aJOIN FETCHexpression can be identified by with an identification variable or not.- Returns:
trueif the expression can have an identification variable;falseotherwise
-
isLocked
protected boolean isLocked(Expression expression)
Determines whether the givenExpressionhas been set has the lock to prevent an infinite recursion.- Parameters:
expression- TheExpressionto check if it is locked- Returns:
trueif the givenExpressionhas been marked as locked;falseotherwise
-
isNotExpression
protected boolean isNotExpression(Expression expression)
Determines whether the givenExpressionrepresents the negated expression.- Parameters:
expression- TheExpressionto visit- Returns:
trueif theExpressionisNotExpression;falseotherwise
-
isPositionWithin
protected 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 cursoroffset- The offset to adjust the positionword- The word to check if the cursor is positioned in it- Returns:
trueif the given position is within the given word;falseotherwise
-
isPositionWithin
protected 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 cursorword- The word to check if the cursor is positioned in it- Returns:
trueif the given position is within the given word;falseotherwise
-
isSubqueryAppendable
protected boolean isSubqueryAppendable(Expression expression)
Determines whether the JPQL identifier starting a subquery (SELECT) can be appended based on the givenExpressionwhich is preceding the position of the cursor.- Parameters:
expression- TheExpressionthat precedes the position of the cursor- Returns:
trueif a subquery can be appended;falseotherwise
-
isValid
protected boolean isValid(Expression expression, JPQLQueryBNF queryBNF)
Determines whether the givenExpressionpart is an expression of the given query BNF.- Parameters:
expression- TheExpressionto validate based on the query BNFqueryBNF-- Returns:
trueif theExpressionpart is a child of the given query BNF;falseotherwise
-
isValid
protected boolean isValid(Expression expression, java.lang.String queryBNFId)
Determines whether the givenExpressionpart is an expression of the given query BNF.- Parameters:
expression- TheExpressionto validate based on the query BNFqueryBNFId-- Returns:
trueif theExpressionpart is a child of the given query BNF;falseotherwise
-
isValid
protected boolean isValid(JPQLQueryBNF parentQueryBNF, JPQLQueryBNF queryBNF)
Determines whether the givenJPQLQueryBNFpart is the given parentJPQLQueryBNF.- Parameters:
parentQueryBNF- The "root" of the BNF used to determine if the other is a descendantqueryBNF- The BNF to check if it is a descendant of the parent- Returns:
trueif theJPQLQueryBNFis a descendant of the given parentJPQLQueryBNF;falseotherwise
-
isValid
protected boolean isValid(JPQLQueryBNF parentQueryBNF, JPQLQueryBNF queryBNF, boolean bypassCompound)
Determines whether the givenJPQLQueryBNFpart is the given parentJPQLQueryBNF.- Parameters:
parentQueryBNF- The "root" of the BNF used to determine if the other is a descendantqueryBNF- The BNF to check if it is a descendant of the parentbypassCompound- Indicates whether aJPQLQueryBNFrepresenting a compound expression should be considered when doing the validation- Returns:
trueif theJPQLQueryBNFis a descendant of the given parentJPQLQueryBNF;falseotherwise
-
isValid
protected boolean isValid(JPQLQueryBNF parentQueryBNF, java.lang.String queryBNFId, boolean bypassCompound)
Determines whether the givenJPQLQueryBNFpart is the given parentJPQLQueryBNF.- Parameters:
parentQueryBNF- The "root" of the BNF used to determine if the other is a descendantqueryBNFId- The unique identifier of theJPQLQueryBNFto check if it is a descendant of the parentbypassCompound- Indicates whether aJPQLQueryBNFrepresenting a compound expression should be considered when doing the validation- Returns:
trueif theJPQLQueryBNFis a descendant of the given parentJPQLQueryBNF;falseotherwise
-
isValidProposal
protected 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 validateword- The word, which is what was parsed before the position of the cursor- Returns:
trueif the proposal is valid;falseotherwise
-
isValidVersion
protected 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:
trueif the given identifier is part of the current JPA version or was defined in previous release;falseotherwise
-
isWithinInvalidExpression
protected boolean isWithinInvalidExpression(Expression expression)
Determines whether the givenExpressionis part of an invalid fragment- Parameters:
expression- TheExpressionto verify its location within the JPQL query- Returns:
trueif the givenExpressionis within an invalid fragment;falseif it is not
-
registerHelper
protected final <T> void registerHelper(java.lang.Class<T> helperClass, T helper)Registers the given helper associated with the given helper class.- Parameters:
helperClass- The Java class of the helper to retrievehelper- The helper being registered- See Also:
getHelper(Class)
-
removeVirtualSpace
protected final void removeVirtualSpace()
Removes the last virtual space from the stack.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
visit
public void visit(AbsExpression expression)
Visits theAbsExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(AbstractSchemaName expression)
Visits theAbstractSchemaNameexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(AdditionExpression expression)
Visits theAdditionExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(AllOrAnyExpression expression)
Visits theAllOrAnyExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(AndExpression expression)
Visits theAndExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(ArithmeticFactor expression)
Visits theArithmeticFactorexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(AvgFunction expression)
Visits theAvgFunctionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(BadExpression expression)
Visits theBadExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(BetweenExpression expression)
Visits theBetweenExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(CaseExpression expression)
Visits theCaseExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(CoalesceExpression expression)
Visits theCoalesceExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(CollectionExpression expression)
Visits theCollectionExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(CollectionMemberDeclaration expression)
Visits theCollectionMemberDeclarationexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(CollectionMemberExpression expression)
Visits theCollectionMemberExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(CollectionValuedPathExpression expression)
Visits theCollectionValuedPathExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(ComparisonExpression expression)
Visits theComparisonExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(ConcatExpression expression)
Visits theConcatExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(ConstructorExpression expression)
Visits theConstructorExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(CountFunction expression)
Visits theCountFunctionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(DateTime expression)
Visits theDateTimeexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(DeleteClause expression)
Visits theDeleteClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(DeleteStatement expression)
Visits theDeleteStatementexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(DivisionExpression expression)
Visits theDivisionExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(EmptyCollectionComparisonExpression expression)
Visits theEmptyCollectionComparisonExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(EntityTypeLiteral expression)
Visits theEntityTypeLiteralexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(EntryExpression expression)
Visits theEntryExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(ExistsExpression expression)
Visits theExistsExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
protected void visit(Expression expression)
Blindly visit the givenExpression.- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(FromClause expression)
Visits theFromClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(FunctionExpression expression)
Visits theFunctionExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(GroupByClause expression)
Visits theGroupByClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(HavingClause expression)
Visits theHavingClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(IdentificationVariable expression)
Visits theIdentificationVariableexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(IdentificationVariableDeclaration expression)
Visits theIdentificationVariableDeclarationexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(IndexExpression expression)
Visits theIndexExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(InExpression expression)
Visits theInExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(InputParameter expression)
Visits theInputParameterexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(Join expression)
Visits theJoinexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(JPQLExpression expression)
Visits theJPQLExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(KeyExpression expression)
Visits theKeyExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(KeywordExpression expression)
Visits theKeywordExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(LengthExpression expression)
Visits theLengthExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(LikeExpression expression)
Visits theLikeExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(LocateExpression expression)
Visits theLocateExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(LowerExpression expression)
Visits theLowerExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(MaxFunction expression)
Visits theMaxFunctionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(MinFunction expression)
Visits theMinFunctionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(ModExpression expression)
Visits theModExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(MultiplicationExpression expression)
Visits theMultiplicationExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(NotExpression expression)
Visits theNotExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(NullComparisonExpression expression)
Visits theNullComparisonExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(NullExpression expression)
Visits theNullExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(NullIfExpression expression)
Visits theNullIfExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(NumericLiteral expression)
Visits theNumericLiteralexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(ObjectExpression expression)
Visits theObjectExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(OnClause expression)
Visits theOnClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(OrderByClause expression)
Visits theOrderByClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(OrderByItem expression)
Visits theOrderByItemexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(OrExpression expression)
Visits theOrExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(RangeVariableDeclaration expression)
Visits theRangeVariableDeclarationexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(ResultVariable expression)
Visits theResultVariableexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(SelectClause expression)
Visits theSelectClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(SelectStatement expression)
Visits theSelectStatementexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(SimpleFromClause expression)
Visits theSimpleFromClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(SimpleSelectClause expression)
Visits theSimpleSelectClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(SimpleSelectStatement expression)
Visits theSimpleSelectStatementexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(SizeExpression expression)
Visits theSizeExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(SqrtExpression expression)
Visits theSqrtExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(StateFieldPathExpression expression)
Visits theStateFieldPathExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(StringLiteral expression)
Visits theStringLiteralexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(SubExpression expression)
Visits theSubExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(SubstringExpression expression)
Visits theSubstringExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(SubtractionExpression expression)
Visits theSubtractionExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(SumFunction expression)
Visits theSumFunctionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(TreatExpression expression)
Visits theTreatExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(TrimExpression expression)
Visits theTrimExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(TypeExpression expression)
Visits theTypeExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
public void visit(UnknownExpression expression)
Visits theUnknownExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheUnknownExpressionto visit
-
visit
public void visit(UpdateClause expression)
Visits theUpdateClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheUpdateClauseto visit
-
visit
public void visit(UpdateItem expression)
Visits theUpdateItemexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheUpdateItemto visit
-
visit
public void visit(UpdateStatement expression)
Visits theUpdateStatementexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheUpdateStatementto visit
-
visit
public void visit(UpperExpression expression)
Visits theUpperExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheUpperExpressionto visit
-
visit
public void visit(ValueExpression expression)
Visits theValueExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheValueExpressionto visit
-
visit
public void visit(WhenClause expression)
Visits theWhenClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheWhenClauseto visit
-
visit
public void visit(WhereClause expression)
Visits theWhereClauseexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheWhereClauseto visit
-
visitAggregateFunction
protected void visitAggregateFunction(AggregateFunction expression)
Visits the givenAggregateFunctionand attempts to find valid proposals.- Parameters:
expression- TheAggregateFunctionto inspect
-
visitArithmeticExpression
protected void visitArithmeticExpression(ArithmeticExpression expression)
Visits the givenArithmeticExpressionand attempts to find valid proposals.- Parameters:
expression- TheArithmeticExpressionto inspect
-
visitCollectionExpression
protected <T extends Expression> void visitCollectionExpression(T expression, java.lang.String identifier, AbstractContentAssistVisitor.CollectionExpressionHelper<T> helper)
Adds the possible proposals for the givenexpressionbased on the location of the cursor and the content of the expression.- Parameters:
expression- Theexpressionbeing visitedidentifier- The JPQL identifier of theExpressionbeing visited, if theExpressiondoes not have an identifier, than an empty string should be passedhelper- This helper completes the behavior of this method by retrieving the information from the givenExpression
-
visitEndingExpression
protected void visitEndingExpression(Expression expression)
-
visitEnumConstant
protected void visitEnumConstant(AbstractPathExpression expression)
-
visitInvalidExpression
protected void visitInvalidExpression(Expression expression)
-
visitLogicalExpression
protected void visitLogicalExpression(LogicalExpression expression)
Visits the givenLogicalExpressionand attempts to find valid proposals.- Parameters:
expression- TheLogicalExpressionto inspect
-
visitPathExpression
protected void visitPathExpression(AbstractPathExpression expression)
Visits the givenAbstractPathExpressionand attempts to find valid proposals.Note: A path expression can represent many things: state field, relationship field, collection field, enum constant, etc. This will consider all variations.
- Parameters:
expression- TheAbstractPathExpressionto inspect
-
visitPathExpression
protected void visitPathExpression(AbstractPathExpression expression, Filter<IMapping> filter)
Visits the givenAbstractPathExpressionby attempting to resolve the path.- Parameters:
expression- TheAbstractPathExpressionto inspectfilter- TheFilteris used to filter outIMappingthat are not valid based on their type and the type that is allowed
-
visitSingleEncapsulatedExpression
protected void visitSingleEncapsulatedExpression(AbstractSingleEncapsulatedExpression expression, AbstractContentAssistVisitor.IdentificationVariableType identificationVariableType)
Adds the possible proposals for the givenexpressionbased on the location of the cursor and the content of the expression.- Parameters:
expression- Theexpressionbeing visitedidentificationVariableType- The type of identification variables that can be added as possible proposals
-
visitSingleEncapsulatedExpression
protected void visitSingleEncapsulatedExpression(AbstractSingleEncapsulatedExpression expression, AbstractContentAssistVisitor.IdentificationVariableType identificationVariableType, java.lang.String... expressionIdentifiers)
Adds the possible proposals for the givenexpressionbased on the location of the cursor and the content of the expression.- Parameters:
expression- Theexpressionbeing visitedidentificationVariableType- The type of identification variables that can be added as possible proposalsexpressionIdentifiers- 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
-
visitStatement
protected <T extends Expression> void visitStatement(T expression, AbstractContentAssistVisitor.StatementHelper<T> helper)
Visits the givenAbstractSelectStatementand checks to see if the identifiers of the following clauses can be added a valid proposals.- Parameters:
expression-helper- This helper handles one clause from the givenSELECTstatement
-
visitThirdPartyPathExpression
protected void visitThirdPartyPathExpression(AbstractPathExpression expression, java.lang.String variableName)
Visits the givenAbstractPathExpressionand attempts to find valid proposals that is not provided by the default implementation. Subclasses can add additional proposals that is outside of the scope of generic JPA metadata.- Parameters:
expression- TheAbstractPathExpressionto inspectvariableName- The beginning of the path expression
-
-