Class AbstractContentAssistVisitor
- All Implemented Interfaces:
ExpressionVisitor
- Direct Known Subclasses:
DefaultContentAssistVisitor
,EclipseLinkContentAssistVisitor
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
protected static class
This helper handles adding proposals within a conditional expression that might be parsed as a single expression or has a collection of expression, which means the fragment is either incomplete or invalid.protected static class
protected static class
AbstractContentAssistVisitor.AbstractGroupByClauseStatementHelper<T extends AbstractSelectStatement>
protected static class
protected static class
protected static class
protected static class
AbstractContentAssistVisitor.AbstractWhereClauseSelectStatementHelper<T extends AbstractSelectStatement>
protected static class
This visitor retrieves the permitted type from the path expression's parent.protected static class
This visitor scans the visitedExpression
and determines if a JPQL identifier can be added ("appended") when the position of the cursor is at the end of the expression.protected static enum
This is used to determine howAbstractContentAssistVisitor.AppendableExpressionVisitor
should perform the check.protected static interface
This helper is used to determine how to add proposals within a collection of expressions.protected static final class
This visitor retrieves theCollectionExpression
if it is visited.protected static final class
protected static final class
protected static final class
This helpers handles adding proposals forAbstractConditionalClause
.protected static final class
protected static final class
protected static final class
The default implementation ofAbstractContentAssistVisitor.MappingCollector
, which simply returns an empty collection.protected static final class
protected static final class
protected static final class
protected static final class
protected static final class
protected static class
This builder populates aQueryPosition
by traversing the valid portion of the JPQL query.protected static final class
This visitor determines whether a path expression can be resolved as a fully qualified enum type and an enum constant.protected static final class
ThisAbstractContentAssistVisitor.MappingCollector
returns the possible mappings (non-collection type or collection type) from a managed type.protected static class
protected static final class
protected static class
protected static class
protected static final class
protected static final class
protected static final class
protected static enum
The various ways of retrieving identification variables from the declaration expression.protected static class
This visitor is used when a clause or a compound expression was parsed with a collection of expressions representing an invalid fragment.protected static final class
This visitor determines if the visitedExpression
is one of the two that represents an invalid expression.protected static final class
protected static interface
A collector is responsible to retrieve the possible proposals by using the mappings that can complete a path expression.protected static final class
This visitor is responsible to create the rightFilter
based on the type of theExpression
.protected static final class
ThisFilter
is responsible to filter out the mappings that can't have their type assignable to the one passed in.protected static final class
protected static final class
protected static class
protected static final class
protected static final class
protected static final class
protected static final class
protected static final class
protected static class
protected static final class
protected static final class
protected static final class
protected static final class
protected static final class
protected static interface
This helper helps to add JPQL identifiers for the clauses that make up a query statement and also chains the clauses within the query.protected static final class
protected static final class
This visitor determines if anExpression
is in a subquery.protected static final class
protected static final class
protected static final class
protected static final class
This visitor is meant to adjust the corrections stack when traversing anExpression
in order to increase the list of valid proposals.protected static final class
This helpers handles adding proposals forWhenClause
.protected static final class
protected static final class
protected static final class
protected static final class
-
Field Summary
Modifier and TypeFieldDescriptionThis is used to change the position of the cursor in order to add possible proposalsThe cached helpers that are used by this visitor to add valid content assist proposals.protected Map
<String, Filter<Expression>> This map contains theFilter
that is used to determine when an identifier is a valid proposal, some of them depends on the expression's type.protected static final Filter
<Expression> ThisFilter
is used to say theExpression
is invalid without doing anything.protected Stack
<Expression> Used to prevent and infinite recursion when one of the visit method is virtually asking a child expression to be visited.protected DefaultContentAssistProposals
The set of possible proposals gathered based on the position in the query.protected final JPQLQueryContext
The context used to query information about the JPQL query.protected QueryPosition
Contains the position of the cursor within the parsedExpression
from the root node up to the deepest leaf node.protected static final int
A constant for the length of a whitespace, which is 1.protected static final Filter
<Expression> ThisFilter
is used to say theExpression
is valid without doing anything.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.protected String
The current word, which was retrieved from the JPQL query based on the position of the cursor.protected WordParser
This is used to retrieve words from the actual JPQL query. -
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractContentAssistVisitor
(JPQLQueryContext queryContext) Creates a newAbstractContentAssistVisitor
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAggregateIdentifier
(String identifier) Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.AGGREGATE
and the beginning starts with the current word.protected void
addAggregateIdentifiers
(String queryBNFId) Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.AGGREGATE
and the beginning starts with the current word.protected void
addAggregateIdentifiers
(JPQLQueryBNF queryBNF) Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.AGGREGATE
and the beginning starts with the current word.protected void
Adds the JPQL identifiers which correspond to the arithmetic operators as valid proposals.protected void
addClauseIdentifier
(String identifier) Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.CLAUSE
and the beginning starts with the current word.protected void
addClauseIdentifiers
(String queryBNFId) Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.CLAUSE
and the beginning starts with the current word.protected void
addClauseIdentifiers
(JPQLQueryBNF queryBNF) Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.CLAUSE
and the beginning starts with the current word.protected void
addComparisonIdentifiers
(Expression expression) Adds the JPQL identifiers which correspond to the comparison operators as valid proposals.protected void
addCompositeIdentifier
(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 void
addCompoundIdentifier
(String identifier, Expression expression, boolean hasIs, boolean hasNot) Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.COMPOUND_FUNCTION
and the beginning starts with the current word.protected void
addCompoundIdentifiers
(String queryBNFId, Expression expression, boolean hasIs, boolean hasNot) Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.COMPOUND_FUNCTION
and the beginning starts with the current word.protected void
addCompoundIdentifiers
(JPQLQueryBNF queryBNF, Expression expression, boolean hasIs, boolean hasNot) Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.COMPOUND_FUNCTION
and the beginning starts with the current word.protected void
Adds the entities as possible content assist proposals but will be filtered using the current word.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
.protected void
addEnumConstant
(IType enumType, String enumConstant) Adds the given enum constant as a valid proposal.protected void
addEnumConstants
(IType enumType, String word) Adds the constants of the given enum type as valid proposals if the beginning starts with the given word.protected void
addExpressionFactoryIdentifiers
(String expressionFactoryId) Adds the JPQL identifiers that were registered with theExpressionFactory
with the given unique identifier.protected void
addExpressionFactoryIdentifiers
(ExpressionFactory expressionFactory) Adds the JPQL identifiers that were registered with the givenExpressionFactory
.protected void
addFunctionIdentifier
(String identifier) Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.FUNCTION
and the beginning starts with the current word.protected void
addFunctionIdentifiers
(String queryBNFId) Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.FUNCTION
and the beginning starts with the current word.protected void
addFunctionIdentifiers
(Expression expression) Adds the JPQL identifiers for which their role isFUNCTION
by determining theJPQLQueryBNF
that represents the fragment for which the givenExpression
was parsed.protected void
addFunctionIdentifiers
(JPQLQueryBNF queryBNF) Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.FUNCTION
and the beginning starts with the current word.protected void
addIdentificationVariable
(String identificationVariable) Adds the given identification variable as a valid proposal.protected void
Adds all the identification variables defined in the current query's FROM clause.protected void
addIdentificationVariables
(Expression expression, AbstractContentAssistVisitor.IdentificationVariableType type) Adds the possible identification variables as valid proposals but filter them based on the given type.protected void
addIdentifier
(String identifier) Adds the given identifier as a proposal if it passes the checks.protected void
Adds the join specification identifiers as proposals.protected void
addLeftIdentificationVariables
(Expression expression) Adds the identification variables defined in the current query's FROM clause that are declared before the givenExpression
.protected void
Adds the logical identifiers, which areAND
andOR
.protected void
addRangeIdentificationVariable
(String identificationVariable) Adds the given identification variable as a proposal if it passes the checks.protected void
Adds the result variables defined in theSELECT
clause as valid proposals.protected final void
Adds a virtual space on the stack.protected boolean
areArithmeticSymbolsAppendable
(Expression expression) Determines whether the givenExpression
can be followed by an arithmetic operator.protected boolean
areComparisonSymbolsAppendable
(Expression expression) Determines whether the givenExpression
can be followed by a comparison operator.protected boolean
areLogicalSymbolsAppendable
(Expression expression) Determines whether the givenExpression
can be followed by a logical operator.protected abstract AbstractContentAssistVisitor.AcceptableTypeVisitor
protected Filter
<Expression> protected Filter
<Expression> protected QueryPosition
buildEndingPositionFromInvalidExpression
(Expression invalidExpression, Expression startingPointExpression, boolean[] virtualSpace) Creates a newQueryPosition
containing the corrected positions starting at the givenExpression
and traversing the children at is always at the right side of the tree.protected AbstractContentAssistVisitor.EnumVisitor
buildFilteringMappingCollector
(AbstractPathExpression expression, Resolver resolver, Filter<IMapping> filter, String pattern) protected AbstractValidator.JPQLQueryBNFValidator
buildJPQLQueryBNFValidator
(JPQLQueryBNF queryBNF) Returns theAbstractValidator.JPQLQueryBNFValidator
that can be used to validate anExpression
by making sure its BNF is part of the given BNF.buildMappingCollector
(AbstractPathExpression expression, Resolver resolver, Filter<IMapping> filter) buildMappingFilter
(AbstractPathExpression expression, Filter<IMapping> filter) buildMappingFilter
(Expression expression) protected Filter
<Expression> 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.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.void
dispose()
Disposes of the internal data.protected RangeVariableDeclaration
findRangeVariableDeclaration
(UpdateClause expression) Retrieves theRangeVariableDeclaration
that defines the entity name and identification variable for the givenUpdateClause
.protected IType
getAcceptableType
(Expression expression) Determines the rootIType
that any type should be assignable.protected CollectionExpression
getCollectionExpression
(Expression expression) Casts the givenExpression
to aCollectionExpression
if it is actually an object of that type.Returns the visitor that collects theCollectionExpression
if it's been visited.protected AbstractContentAssistVisitor.EnumVisitor
protected ExpressionFactory
getExpressionFactory
(String expressionFactoryId) Retrieves the registeredExpressionFactory
that was registered for the given unique identifier.protected Filter
<Expression> protected final <T> T
Retrieves the helper associated with the given helper class.protected IdentifierRole
getIdentifierRole
(String identifier) Retrieves the role of the given identifier.protected abstract JPQLGrammar
Returns the latest supported JPQL grammar, which is required when checking the validity of a JPQL identifier.protected JPQLQueryBNF
getQueryBNF
(String queryBNFId) Retrieves theJPQLQueryBNF
that was registered for the given unique identifier.protected boolean
hasClausesDefinedBetween
(Expression expression, String afterIdentifier, String beforeIdentifier) protected final boolean
Determines whether there is a virtual space to be considered or not.protected void
Initializes this visitor.protected boolean
isAggregate
(String identifier) Determines whether the given JPQL identifier used in an aggregate expression; for instance AND.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
.protected boolean
isAppendableToCollection
(Expression expression) Determines whetherprotected boolean
Determines whether the given JPQL identifier used in a clause; for instance SELECT.protected boolean
isClauseAppendable
(Expression expression) Determines whether the identifiers identifying clauses can be appended to the JPQL query based on the givenExpression
.protected boolean
isComplete
(Expression expression) Determines whether the givenExpression
is grammatically complete.protected boolean
isCompoundable
(Expression expression) Determines whether the givenExpression
can be used as the left side of a compound expression.protected boolean
isCompoundFunction
(String identifier) Determines whether the given JPQL identifier used in a compound expression; an example would be BETWEEN or MEMBER.protected boolean
isDeclaration
(AbstractPathExpression expression) Determines whether the givenAbstractPathExpression
is found within a declaration expression.protected boolean
isEncapsulated
(Expression expression) Determines whether the givenExpression
is being encapsulated or not.protected boolean
isEnumAllowed
(AbstractPathExpression expression) Determines whether the givenAbstractPathExpression
could potentially represent a fully qualified enum constant, which is dictated by the location of the path expression within the query.protected boolean
isFollowingInvalidExpression
(Expression expression) Determines whether the givenExpression
is preceded by an invalid expression.protected boolean
isFunction
(String identifier) Determines whether the given JPQL identifier is a function, an example would be AVG.protected boolean
isInSubquery
(Expression expression) Determines whether the givenExpression
is in a subquery or in the top-level query.protected boolean
isInvalidExpression
(Expression expression) Determines whether the givenExpression
represents an invalid fragment.protected abstract boolean
Determines whether aJOIN FETCH
expression can be identified by with an identification variable or not.protected boolean
isLocked
(Expression expression) Determines whether the givenExpression
has been set has the lock to prevent an infinite recursion.protected boolean
isNotExpression
(Expression expression) Determines whether the givenExpression
represents the negated expression.protected boolean
isPositionWithin
(int position, int offset, String word) Determines whether the given position is within the given word.protected boolean
isPositionWithin
(int position, String word) Determines whether the given position is within the given word.protected boolean
isSubqueryAppendable
(Expression expression) Determines whether the JPQL identifier starting a subquery (SELECT
) can be appended based on the givenExpression
which is preceding the position of the cursor.protected boolean
isValid
(Expression expression, String queryBNFId) Determines whether the givenExpression
part is an expression of the given query BNF.protected boolean
isValid
(Expression expression, JPQLQueryBNF queryBNF) Determines whether the givenExpression
part is an expression of the given query BNF.protected boolean
isValid
(JPQLQueryBNF parentQueryBNF, String queryBNFId, boolean bypassCompound) Determines whether the givenJPQLQueryBNF
part is the given parentJPQLQueryBNF
.protected boolean
isValid
(JPQLQueryBNF parentQueryBNF, JPQLQueryBNF queryBNF) Determines whether the givenJPQLQueryBNF
part is the given parentJPQLQueryBNF
.protected boolean
isValid
(JPQLQueryBNF parentQueryBNF, JPQLQueryBNF queryBNF, boolean bypassCompound) Determines whether the givenJPQLQueryBNF
part is the given parentJPQLQueryBNF
.protected boolean
isValidProposal
(String proposal, String word) Determines whether the given proposal is a valid, which is based on the content of the given word.protected boolean
isValidVersion
(String identifier) Determines whether the given JPQL identifier can be a valid proposal, i.e.protected boolean
isWithinInvalidExpression
(Expression expression) Determines whether the givenExpression
is part of an invalid fragmentprotected final <T> void
registerHelper
(Class<T> helperClass, T helper) Registers the given helper associated with the given helper class.protected final void
Removes the last virtual space from the stack.toString()
void
visit
(AbsExpression expression) Visits theAbsExpression
expression.void
visit
(AbstractSchemaName expression) Visits theAbstractSchemaName
expression.void
visit
(AdditionExpression expression) Visits theAdditionExpression
expression.void
visit
(AllOrAnyExpression expression) Visits theAllOrAnyExpression
expression.void
visit
(AndExpression expression) Visits theAndExpression
expression.void
visit
(ArithmeticFactor expression) Visits theArithmeticFactor
expression.void
visit
(AvgFunction expression) Visits theAvgFunction
expression.void
visit
(BadExpression expression) Visits theBadExpression
expression.void
visit
(BetweenExpression expression) Visits theBetweenExpression
expression.void
visit
(CaseExpression expression) Visits theCaseExpression
expression.void
visit
(CoalesceExpression expression) Visits theCoalesceExpression
expression.void
visit
(CollectionExpression expression) Visits theCollectionExpression
expression.void
visit
(CollectionMemberDeclaration expression) Visits theCollectionMemberDeclaration
expression.void
visit
(CollectionMemberExpression expression) Visits theCollectionMemberExpression
expression.void
visit
(CollectionValuedPathExpression expression) Visits theCollectionValuedPathExpression
expression.void
visit
(ComparisonExpression expression) Visits theComparisonExpression
expression.void
visit
(ConcatExpression expression) Visits theConcatExpression
expression.void
visit
(ConstructorExpression expression) Visits theConstructorExpression
expression.void
visit
(CountFunction expression) Visits theCountFunction
expression.void
Visits theDateTime
expression.void
visit
(DeleteClause expression) Visits theDeleteClause
expression.void
visit
(DeleteStatement expression) Visits theDeleteStatement
expression.void
visit
(DivisionExpression expression) Visits theDivisionExpression
expression.void
visit
(EmptyCollectionComparisonExpression expression) Visits theEmptyCollectionComparisonExpression
expression.void
visit
(EntityTypeLiteral expression) Visits theEntityTypeLiteral
expression.void
visit
(EntryExpression expression) Visits theEntryExpression
expression.void
visit
(ExistsExpression expression) Visits theExistsExpression
expression.protected void
visit
(Expression expression) Blindly visit the givenExpression
.void
visit
(FromClause expression) Visits theFromClause
expression.void
visit
(FunctionExpression expression) Visits theFunctionExpression
expression.void
visit
(GroupByClause expression) Visits theGroupByClause
expression.void
visit
(HavingClause expression) Visits theHavingClause
expression.void
visit
(IdentificationVariable expression) Visits theIdentificationVariable
expression.void
visit
(IdentificationVariableDeclaration expression) Visits theIdentificationVariableDeclaration
expression.void
visit
(IndexExpression expression) Visits theIndexExpression
expression.void
visit
(InExpression expression) Visits theInExpression
expression.void
visit
(InputParameter expression) Visits theInputParameter
expression.void
Visits theJoin
expression.void
visit
(JPQLExpression expression) Visits theJPQLExpression
expression.void
visit
(KeyExpression expression) Visits theKeyExpression
expression.void
visit
(KeywordExpression expression) Visits theKeywordExpression
expression.void
visit
(LengthExpression expression) Visits theLengthExpression
expression.void
visit
(LikeExpression expression) Visits theLikeExpression
expression.void
visit
(LocalDateTime expression) Visits theLocalDateTime
expression.void
visit
(LocalExpression expression) Visits theLocalExpression
expression.void
visit
(LocateExpression expression) Visits theLocateExpression
expression.void
visit
(LowerExpression expression) Visits theLowerExpression
expression.void
visit
(MathDoubleExpression.Power expression) Visits theMathDoubleExpression.Power
expression.void
visit
(MathDoubleExpression.Round expression) Visits theMathDoubleExpression.Round
expression.void
visit
(MathSingleExpression.Ceiling expression) Visits theMathSingleExpression.Ceiling
expression.void
visit
(MathSingleExpression.Exp expression) Visits theMathSingleExpression.Exp
expression.void
visit
(MathSingleExpression.Floor expression) Visits theMathSingleExpression.Floor
expression.void
visit
(MathSingleExpression.Ln expression) Visits theMathSingleExpression.Ln
expression.void
visit
(MathSingleExpression.Sign expression) Visits theMathSingleExpression.Sign
expression.void
visit
(MaxFunction expression) Visits theMaxFunction
expression.void
visit
(MinFunction expression) Visits theMinFunction
expression.void
visit
(ModExpression expression) Visits theModExpression
expression.void
visit
(MultiplicationExpression expression) Visits theMultiplicationExpression
expression.void
visit
(NotExpression expression) Visits theNotExpression
expression.void
visit
(NullComparisonExpression expression) Visits theNullComparisonExpression
expression.void
visit
(NullExpression expression) Visits theNullExpression
expression.void
visit
(NullIfExpression expression) Visits theNullIfExpression
expression.void
visit
(NumericLiteral expression) Visits theNumericLiteral
expression.void
visit
(ObjectExpression expression) Visits theObjectExpression
expression.void
Visits theOnClause
expression.void
visit
(OrderByClause expression) Visits theOrderByClause
expression.void
visit
(OrderByItem expression) Visits theOrderByItem
expression.void
visit
(OrExpression expression) Visits theOrExpression
expression.void
visit
(RangeVariableDeclaration expression) Visits theRangeVariableDeclaration
expression.void
visit
(ResultVariable expression) Visits theResultVariable
expression.void
visit
(SelectClause expression) Visits theSelectClause
expression.void
visit
(SelectStatement expression) Visits theSelectStatement
expression.void
visit
(SimpleFromClause expression) Visits theSimpleFromClause
expression.void
visit
(SimpleSelectClause expression) Visits theSimpleSelectClause
expression.void
visit
(SimpleSelectStatement expression) Visits theSimpleSelectStatement
expression.void
visit
(SizeExpression expression) Visits theSizeExpression
expression.void
visit
(SqrtExpression expression) Visits theSqrtExpression
expression.void
visit
(StateFieldPathExpression expression) Visits theStateFieldPathExpression
expression.void
visit
(StringLiteral expression) Visits theStringLiteral
expression.void
visit
(SubExpression expression) Visits theSubExpression
expression.void
visit
(SubstringExpression expression) Visits theSubstringExpression
expression.void
visit
(SubtractionExpression expression) Visits theSubtractionExpression
expression.void
visit
(SumFunction expression) Visits theSumFunction
expression.void
visit
(TreatExpression expression) Visits theTreatExpression
expression.void
visit
(TrimExpression expression) Visits theTrimExpression
expression.void
visit
(TypeExpression expression) Visits theTypeExpression
expression.void
visit
(UnknownExpression expression) Visits theUnknownExpression
expression.void
visit
(UpdateClause expression) Visits theUpdateClause
expression.void
visit
(UpdateItem expression) Visits theUpdateItem
expression.void
visit
(UpdateStatement expression) Visits theUpdateStatement
expression.void
visit
(UpperExpression expression) Visits theUpperExpression
expression.void
visit
(ValueExpression expression) Visits theValueExpression
expression.void
visit
(WhenClause expression) Visits theWhenClause
expression.void
visit
(WhereClause expression) Visits theWhereClause
expression.protected void
visitAggregateFunction
(AggregateFunction expression) Visits the givenAggregateFunction
and attempts to find valid proposals.protected void
visitArithmeticExpression
(ArithmeticExpression expression) Visits the givenArithmeticExpression
and attempts to find valid proposals.protected <T extends Expression>
voidvisitCollectionExpression
(T expression, String identifier, AbstractContentAssistVisitor.CollectionExpressionHelper<T> helper) Adds the possible proposals for the givenexpression
based on the location of the cursor and the content of the expression.protected void
visitEndingExpression
(Expression expression) protected void
visitEnumConstant
(AbstractPathExpression expression) protected void
visitInvalidExpression
(Expression expression) protected void
visitLogicalExpression
(LogicalExpression expression) Visits the givenLogicalExpression
and attempts to find valid proposals.protected void
visitPathExpression
(AbstractPathExpression expression) Visits the givenAbstractPathExpression
and attempts to find valid proposals.protected void
visitPathExpression
(AbstractPathExpression expression, Filter<IMapping> filter) Visits the givenAbstractPathExpression
by attempting to resolve the path.protected void
visitSingleEncapsulatedExpression
(AbstractSingleEncapsulatedExpression expression, AbstractContentAssistVisitor.IdentificationVariableType identificationVariableType) Adds the possible proposals for the givenexpression
based on the location of the cursor and the content of the expression.protected void
visitSingleEncapsulatedExpression
(AbstractSingleEncapsulatedExpression expression, AbstractContentAssistVisitor.IdentificationVariableType identificationVariableType, String... expressionIdentifiers) Adds the possible proposals for the givenexpression
based 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 givenAbstractSelectStatement
and checks to see if the identifiers of the following clauses can be added a valid proposals.protected void
visitThirdPartyPathExpression
(AbstractPathExpression expression, String variableName) Visits the givenAbstractPathExpression
and attempts to find valid proposals that is not provided by the default implementation.
-
Field Details
-
corrections
This is used to change the position of the cursor in order to add possible proposals -
helpers
The cached helpers that are used by this visitor to add valid content assist proposals. -
identifierFilters
This map contains theFilter
that is used to determine when an identifier is a valid proposal, some of them depends on the expression's type. -
lockedExpressions
Used to prevent and infinite recursion when one of the visit method is virtually asking a child expression to be visited. -
proposals
The set of possible proposals gathered based on the position in the query. -
queryContext
The context used to query information about the JPQL query. -
queryPosition
Contains the position of the cursor within the parsedExpression
from the root node up to the deepest leaf node. -
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
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
This is used to retrieve words from the actual JPQL query. -
INVALID_IDENTIFIER_FILTER
ThisFilter
is used to say theExpression
is invalid without doing anything. -
SPACE_LENGTH
protected static final int SPACE_LENGTHA constant for the length of a whitespace, which is 1.- See Also:
-
VALID_IDENTIFIER_FILTER
ThisFilter
is used to say theExpression
is valid without doing anything.
-
-
Constructor Details
-
AbstractContentAssistVisitor
Creates a newAbstractContentAssistVisitor
.- Parameters:
queryContext
- The context used to query information about the JPQL query- Throws:
NullPointerException
- TheJPQLQueryContext
cannot benull
-
-
Method Details
-
addAggregateIdentifier
Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.AGGREGATE
and the beginning starts with the current word.- Parameters:
identifier
- The JPQL identifier to add as a valid proposal if it passes the checks
-
addAggregateIdentifiers
Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.AGGREGATE
and the beginning starts with the current word.- Parameters:
queryBNF
- TheJPQLQueryBNF
for which the registered JPQL identifiers will be added as proposals if they pass the checks
-
addAggregateIdentifiers
Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.AGGREGATE
and the beginning starts with the current word.- Parameters:
queryBNFId
- The unique of theJPQLQueryBNF
for 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
Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.CLAUSE
and the beginning starts with the current word.- Parameters:
identifier
- The JPQL identifier to add as a valid proposal if it passes the checks
-
addClauseIdentifiers
Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.CLAUSE
and the beginning starts with the current word.- Parameters:
queryBNF
- TheJPQLQueryBNF
for which the registered JPQL identifiers will be added as proposals if they pass the checks
-
addClauseIdentifiers
Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.CLAUSE
and the beginning starts with the current word.- Parameters:
queryBNFId
- The unique identifier of theJPQLQueryBNF
for which the registered JPQL identifiers will be added as proposals if they pass the checks
-
addComparisonIdentifiers
Adds the JPQL identifiers which correspond to the comparison operators as valid proposals. The word has to be an empty string.- Parameters:
expression
- TheExpression
is preceding the position of the cursor and will help to determine which of the comparison operators are valid
-
addCompositeIdentifier
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 BY
offset
- 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(String identifier, Expression expression, boolean hasIs, boolean hasNot) Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.COMPOUND_FUNCTION
and the beginning starts with the current word.- Parameters:
identifier
- The JPQL identifier to add as a valid proposal if it passes the checksexpression
- TheExpression
represents the fragment that is before the current word and it helps to filter out some of the compound identifiershasIs
- Flag indicating if theIS
identifier was found before the word, which would also be before theNOT
identifier if it was also foundhasNot
- Flag indicating if theNOT
identifier 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 givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.COMPOUND_FUNCTION
and the beginning starts with the current word.- Parameters:
queryBNF
- TheJPQLQueryBNF
for which the registered JPQL identifiers will be added as proposals if they pass the checksexpression
- TheExpression
represents the fragment that is before the current word and it helps to filter out some of the compound identifiershasIs
- Flag indicating if theIS
identifier was found before the word, which would also be before theNOT
identifier if it was also foundhasNot
- Flag indicating if theNOT
identifier was found before the word
-
addCompoundIdentifiers
protected void addCompoundIdentifiers(String queryBNFId, Expression expression, boolean hasIs, boolean hasNot) Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.COMPOUND_FUNCTION
and the beginning starts with the current word.- Parameters:
queryBNFId
- The unique identifier of theJPQLQueryBNF
for which the registered JPQL identifiers will be added as proposals if they pass the checksexpression
- TheExpression
represents the fragment that is before the current word and it helps to filter out some of the compound identifiershasIs
- Flag indicating if theIS
identifier was found before the word, which would also be before theNOT
identifier if it was also foundhasNot
- Flag indicating if theNOT
identifier 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
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
- TheIType
used to filter the abstract schema types
-
addEnumConstant
Adds the given enum constant as a valid proposal. -
addEnumConstants
Adds the constants of the given enum type as valid proposals if the beginning starts with the given word.- Parameters:
enumType
- TheIType
of the enum typeword
- The word is used to filter the enum constants, which can benull
or an empty string
-
addExpressionFactoryIdentifiers
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
Adds the JPQL identifiers that were registered with theExpressionFactory
with 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
Adds the given JPQL identifier as a valid proposal if its role isIdentifierRole.FUNCTION
and the beginning starts with the current word.- Parameters:
identifier
- The JPQL identifier to add as a valid proposal if it passes the checks
-
addFunctionIdentifiers
Adds the JPQL identifiers for which their role isFUNCTION
by determining theJPQLQueryBNF
that represents the fragment for which the givenExpression
was 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
SELECT
will also be added.The identification variables will also be added.
- Parameters:
expression
- TheExpression
is used to determine theJPQLQueryBNF
to use when retrieving the JPQL identifiers representing a function
-
addFunctionIdentifiers
Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.FUNCTION
and the beginning starts with the current word.- Parameters:
queryBNF
- TheJPQLQueryBNF
for which the registered JPQL identifiers will be added as proposals if they pass the checks
-
addFunctionIdentifiers
Adds the JPQL identifiers that are registered with the givenJPQLQueryBNF
as valid proposals if their role isIdentifierRole.FUNCTION
and the beginning starts with the current word.- Parameters:
queryBNFId
- The unique identifier of theJPQLQueryBNF
for which the registered JPQL identifiers will be added as proposals if they pass the checks
-
addIdentificationVariable
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 givenExpression
are valid proposals, but those defined after are not valid proposals.- Parameters:
expression
- TheExpression
where 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
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
Adds the identification variables defined in the current query's FROM clause that are declared before the givenExpression
.- Parameters:
expression
- TheExpression
used to determine at which declaration to stop
-
addLogicalIdentifiers
protected void addLogicalIdentifiers()Adds the logical identifiers, which areAND
andOR
. -
addRangeIdentificationVariable
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 theSELECT
clause as valid proposals. -
addVirtualSpace
protected final void addVirtualSpace()Adds a virtual space on the stack. -
areArithmeticSymbolsAppendable
Determines whether the givenExpression
can be followed by an arithmetic operator.- Parameters:
expression
- TheExpression
that found left of the cursor, which determines if the arithmetic operators are appendable or not- Returns:
true
if the operators are appendable;false
otherwise
-
areComparisonSymbolsAppendable
Determines whether the givenExpression
can be followed by a comparison operator.- Parameters:
expression
- TheExpression
that found left of the cursor, which determines if the comparison operators are appendable or not- Returns:
true
if the operators are appendable;false
otherwise
-
areLogicalSymbolsAppendable
Determines whether the givenExpression
can be followed by a logical operator.- Parameters:
expression
- TheExpression
that found left of the cursor, which determines if the logical operators are appendable or not- Returns:
true
if the logical identifiers are appendable;false
otherwise
-
buildAcceptableTypeVisitor
-
buildAppendableExpressionVisitor
protected AbstractContentAssistVisitor.AppendableExpressionVisitor buildAppendableExpressionVisitor() -
buildCollectionCompoundTypeFilter
-
buildCollectionExpressionVisitor
protected AbstractContentAssistVisitor.CollectionExpressionVisitor buildCollectionExpressionVisitor() -
buildCollectionMappingFilter
-
buildConcatExpressionCollectionHelper
protected AbstractContentAssistVisitor.ConcatExpressionCollectionHelper buildConcatExpressionCollectionHelper() -
buildConditionalClauseCollectionHelper
protected AbstractContentAssistVisitor.ConditionalClauseCollectionHelper buildConditionalClauseCollectionHelper() -
buildConstrutorCollectionHelper
-
buildDeclarationVisitor
-
buildDefaultMappingCollector
-
buildDeleteClauseCollectionHelper
protected AbstractContentAssistVisitor.DeleteClauseCollectionHelper buildDeleteClauseCollectionHelper() -
buildDeleteClauseStatementHelper
protected AbstractContentAssistVisitor.DeleteClauseStatementHelper buildDeleteClauseStatementHelper() -
buildDifferentComparisonFilter
-
buildDoubleEncapsulatedCollectionHelper
protected AbstractContentAssistVisitor.DoubleEncapsulatedCollectionHelper buildDoubleEncapsulatedCollectionHelper() -
buildEncapsulatedExpressionVisitor
protected AbstractContentAssistVisitor.EncapsulatedExpressionVisitor buildEncapsulatedExpressionVisitor() -
buildEndingPositionFromInvalidExpression
protected QueryPosition buildEndingPositionFromInvalidExpression(Expression invalidExpression, Expression startingPointExpression, boolean[] virtualSpace) Creates a newQueryPosition
containing the corrected positions starting at the givenExpression
and traversing the children at is always at the right side of the tree.- Parameters:
invalidExpression
- The invalidExpression
for which a newQueryPosition
will be calculatedstartingPointExpression
- TheExpression
from 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
QueryPosition
that contains the position of the cursor starting from the givenExpression
down to the right leaf
-
buildEndingQueryPositionBuilder
-
buildEnumVisitor
-
buildFilteringMappingCollector
protected AbstractContentAssistVisitor.FilteringMappingCollector buildFilteringMappingCollector(AbstractPathExpression expression, Resolver resolver, Filter<IMapping> filter, String pattern) -
buildFollowingClausesVisitor
-
buildFollowingInvalidExpressionVisitor
protected AbstractContentAssistVisitor.FollowingInvalidExpressionVisitor buildFollowingInvalidExpressionVisitor() -
buildFromClauseCollectionHelper
-
buildFromClauseStatementHelper
-
buildGroupByClauseCollectionHelper
protected AbstractContentAssistVisitor.GroupByClauseCollectionHelper buildGroupByClauseCollectionHelper() -
buildGroupByClauseStatementHelper
protected AbstractContentAssistVisitor.GroupByClauseStatementHelper buildGroupByClauseStatementHelper() -
buildHavingClauseStatementHelper
protected AbstractContentAssistVisitor.HavingClauseStatementHelper buildHavingClauseStatementHelper() -
buildIncompleteCollectionExpressionVisitor
protected AbstractContentAssistVisitor.IncompleteCollectionExpressionVisitor buildIncompleteCollectionExpressionVisitor() -
buildInvalidExpressionVisitor
-
buildJoinCollectionHelper
-
buildJPQLQueryBNFValidator
Returns theAbstractValidator.JPQLQueryBNFValidator
that can be used to validate anExpression
by making sure its BNF is part of the given BNF.- Parameters:
queryBNF
- The BNF used to determine the validity of anExpression
- Returns:
- A
AbstractValidator.JPQLQueryBNFValidator
that can determine if anExpression
follows 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
-
buildMappingFilterBuilder
-
buildNonCollectionCompoundTypeFilter
-
buildNotExpressionVisitor
-
buildOrderByClauseCollectionHelper
protected AbstractContentAssistVisitor.OrderByClauseCollectionHelper buildOrderByClauseCollectionHelper() -
buildOrderByClauseStatementHelper
protected AbstractContentAssistVisitor.OrderByClauseStatementHelper buildOrderByClauseStatementHelper() -
buildPropertyMappingFilter
-
buildProposals
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
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
-
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
-
buildTripleEncapsulatedCollectionHelper
protected AbstractContentAssistVisitor.TripleEncapsulatedCollectionHelper buildTripleEncapsulatedCollectionHelper() -
buildUpdateClauseStatementHelper
protected AbstractContentAssistVisitor.UpdateClauseStatementHelper buildUpdateClauseStatementHelper() -
buildUpdateItemCollectionHelper
-
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
Retrieves theRangeVariableDeclaration
that defines the entity name and identification variable for the givenUpdateClause
.- Returns:
- Either the
RangeVariableDeclaration
if the JPQL query defines it ornull
if it was not defined
-
getAcceptableType
Determines the rootIType
that any type should be assignable. If theIType
isNumber
, than any subclasses will be allowed.- Parameters:
expression
- TheExpression
to visit, including its parent hierarchy until anExpression
requires a certainIType
- Returns:
- The root
IType
allowed ornull
if anything is allowed
-
getAppendableExpressionVisitor
-
getCollectionExpression
Casts the givenExpression
to aCollectionExpression
if it is actually an object of that type.- Parameters:
expression
- TheExpression
to cast- Returns:
- The given
Expression
if it is aCollectionExpression
ornull
if it is any other object
-
getCollectionExpressionVisitor
Returns the visitor that collects theCollectionExpression
if it's been visited.- Returns:
- The
AbstractContentAssistVisitor.CollectionExpressionVisitor
- See Also:
-
getConcatExpressionCollectionHelper
protected AbstractContentAssistVisitor.ConcatExpressionCollectionHelper getConcatExpressionCollectionHelper() -
getConditionalClauseCollectionHelper
protected AbstractContentAssistVisitor.ConditionalClauseCollectionHelper getConditionalClauseCollectionHelper() -
getConstructorCollectionHelper
-
getDeclarationVisitor
-
getDefaultMappingCollector
-
getDeleteClauseCollectionHelper
protected AbstractContentAssistVisitor.DeleteClauseCollectionHelper getDeleteClauseCollectionHelper() -
getDeleteClauseStatementHelper
-
getDoubleEncapsulatedCollectionHelper
protected AbstractContentAssistVisitor.DoubleEncapsulatedCollectionHelper getDoubleEncapsulatedCollectionHelper() -
getEncapsulatedExpressionVisitor
protected AbstractContentAssistVisitor.EncapsulatedExpressionVisitor getEncapsulatedExpressionVisitor() -
getEndingQueryPositionBuilder
-
getEnumVisitor
-
getExpressionFactory
Retrieves the registeredExpressionFactory
that was registered for the given unique identifier.- Parameters:
expressionFactoryId
- The unique identifier of theExpressionFactory
to retrieve- Returns:
- The
ExpressionFactory
mapped with the given unique identifier
-
getExpressionTypeVisitor
-
getFilter
-
getFollowingClausesVisitor
-
getFollowingInvalidExpressionVisitor
protected AbstractContentAssistVisitor.FollowingInvalidExpressionVisitor getFollowingInvalidExpressionVisitor() -
getFromClauseCollectionHelper
-
getFromClauseStatementHelper
-
getGroupByClauseCollectionHelper
protected AbstractContentAssistVisitor.GroupByClauseCollectionHelper getGroupByClauseCollectionHelper() -
getGroupByClauseStatementHelper
protected AbstractContentAssistVisitor.GroupByClauseStatementHelper getGroupByClauseStatementHelper() -
getHavingClauseStatementHelper
-
getHelper
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
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
-
getJoinCollectionHelper
-
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
JPQLGrammar
supported by the provider
-
getMappingCollectionFilter
-
getMappingFilterBuilder
-
getMappingPropertyFilter
-
getNotExpressionVisitor
-
getOrderByClauseCollectionHelper
protected AbstractContentAssistVisitor.OrderByClauseCollectionHelper getOrderByClauseCollectionHelper() -
getOrderByClauseStatementHelper
protected AbstractContentAssistVisitor.OrderByClauseStatementHelper getOrderByClauseStatementHelper() -
getQueryBNF
Retrieves theJPQLQueryBNF
that was registered for the given unique identifier.- Parameters:
queryBNFId
- The unique identifier of theJPQLQueryBNF
to retrieve- Returns:
- The
JPQLQueryBNF
representing a section of the grammar
-
getRangeVariableDeclarationVisitor
protected AbstractContentAssistVisitor.RangeVariableDeclarationVisitor getRangeVariableDeclarationVisitor() -
getResultVariableVisitor
-
getSelectClauseCollectionHelper
protected AbstractContentAssistVisitor.SelectClauseCollectionHelper getSelectClauseCollectionHelper() -
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
-
getTripleEncapsulatedCollectionHelper
protected AbstractContentAssistVisitor.TripleEncapsulatedCollectionHelper getTripleEncapsulatedCollectionHelper() -
getUpdateClauseStatementHelper
-
getUpdateItemCollectionHelper
-
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, String afterIdentifier, String beforeIdentifier) -
hasVirtualSpace
protected final boolean hasVirtualSpace()Determines whether there is a virtual space to be considered or not.- Returns:
true
if there is a virtual space to count as a real one or not
-
initialize
protected void initialize()Initializes this visitor. -
isAggregate
Determines whether the given JPQL identifier used in an aggregate expression; for instance AND.- Parameters:
identifier
- The identifier to validate- Returns:
true
if the given identifier is used in an aggregate expression;false
otherwise
-
isAppendable
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
- TheExpression
that determines what can be appendedappendableType
- The type of identifiers to append to the JPQL query- Returns:
true
if the JPQL identifiers with the given type can be appended to the JPQL query;false
if they cannot
-
isAppendableToCollection
Determines whether -
isClause
Determines whether the given JPQL identifier used in a clause; for instance SELECT.- Parameters:
identifier
- The identifier to validate- Returns:
true
if the given identifier is a clause;false
otherwise
-
isClauseAppendable
Determines whether the identifiers identifying clauses can be appended to the JPQL query based on the givenExpression
.- Parameters:
expression
- TheExpression
that determines what can be appended- Returns:
true
if the following clauses can be appended to the JPQL query;false
if they cannot
-
isComplete
Determines whether the givenExpression
is grammatically complete.- Parameters:
expression
- TheExpression
to verify its grammar integrity- Returns:
true
if theExpression
is grammatically complete;false
otherwise
-
isCompoundable
Determines whether the givenExpression
can be used as the left side of a compound expression.- Parameters:
expression
- TheExpression
that determines if the JPQL identifiers withIdentifierRole.COMPOUND_FUNCTION
can be used to create a compound expression- Returns:
true
if the compound identifiers can be appended to the JPQL query;false
if they cannot
-
isCompoundFunction
Determines whether the given JPQL identifier used in a compound expression; an example would be BETWEEN or MEMBER.- Parameters:
identifier
- The identifier to validate- Returns:
true
if the given identifier is used in a compound expression;false
otherwise
-
isDeclaration
Determines whether the givenAbstractPathExpression
is found within a declaration expression.- Parameters:
expression
- TheAbstractPathExpression
to visit- Returns:
true
if the visitedCollectionValuedPathExpression
is owned by aRangeVariableDeclaration
, which indicates it is used to define the "root" object;false
if it is not
-
isEncapsulated
Determines whether the givenExpression
is being encapsulated or not.- Parameters:
expression
- TheExpression
to scan for encapsulation- Returns:
true
if the givenExpression
is within parenthesis;false
otherwise
-
isEnumAllowed
Determines whether the givenAbstractPathExpression
could 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
- TheAbstractPathExpression
to visit- Returns:
true
if the path expression represents a enum constant;false
otherwise
-
isFollowingInvalidExpression
Determines whether the givenExpression
is preceded by an invalid expression.- Parameters:
expression
- TheExpression
to visit- Returns:
true
if the visitedExpression
is part of a collection of expressions and an invalid expression precede it;false
otherwise
-
isFunction
Determines whether the given JPQL identifier is a function, an example would be AVG.- Parameters:
identifier
- The identifier to validate- Returns:
true
if the given identifier is a function;false
otherwise
-
isInSubquery
Determines whether the givenExpression
is in a subquery or in the top-level query.- Parameters:
expression
- TheExpression
to visit its parent hierarchy- Returns:
true
if the owning query is a subquery;false
if it's the top-level query
-
isInvalidExpression
Determines whether the givenExpression
represents an invalid fragment.- Parameters:
expression
- TheExpression
to visit- Returns:
true
if theExpression
is an invalid fragment;false
otherwise
-
isJoinFetchIdentifiable
protected abstract boolean isJoinFetchIdentifiable()Determines whether aJOIN FETCH
expression can be identified by with an identification variable or not.- Returns:
true
if the expression can have an identification variable;false
otherwise
-
isLocked
Determines whether the givenExpression
has been set has the lock to prevent an infinite recursion.- Parameters:
expression
- TheExpression
to check if it is locked- Returns:
true
if the givenExpression
has been marked as locked;false
otherwise
-
isNotExpression
Determines whether the givenExpression
represents the negated expression.- Parameters:
expression
- TheExpression
to visit- Returns:
true
if theExpression
isNotExpression
;false
otherwise
-
isPositionWithin
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:
true
if the given position is within the given word;false
otherwise
-
isPositionWithin
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:
true
if the given position is within the given word;false
otherwise
-
isSubqueryAppendable
Determines whether the JPQL identifier starting a subquery (SELECT
) can be appended based on the givenExpression
which is preceding the position of the cursor.- Parameters:
expression
- TheExpression
that precedes the position of the cursor- Returns:
true
if a subquery can be appended;false
otherwise
-
isValid
Determines whether the givenExpression
part is an expression of the given query BNF.- Parameters:
expression
- TheExpression
to validate based on the query BNF- Returns:
true
if theExpression
part is a child of the given query BNF;false
otherwise
-
isValid
Determines whether the givenExpression
part is an expression of the given query BNF.- Parameters:
expression
- TheExpression
to validate based on the query BNF- Returns:
true
if theExpression
part is a child of the given query BNF;false
otherwise
-
isValid
Determines whether the givenJPQLQueryBNF
part 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:
true
if theJPQLQueryBNF
is a descendant of the given parentJPQLQueryBNF
;false
otherwise
-
isValid
protected boolean isValid(JPQLQueryBNF parentQueryBNF, JPQLQueryBNF queryBNF, boolean bypassCompound) Determines whether the givenJPQLQueryBNF
part 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 aJPQLQueryBNF
representing a compound expression should be considered when doing the validation- Returns:
true
if theJPQLQueryBNF
is a descendant of the given parentJPQLQueryBNF
;false
otherwise
-
isValid
Determines whether the givenJPQLQueryBNF
part is the given parentJPQLQueryBNF
.- Parameters:
parentQueryBNF
- The "root" of the BNF used to determine if the other is a descendantqueryBNFId
- The unique identifier of theJPQLQueryBNF
to check if it is a descendant of the parentbypassCompound
- Indicates whether aJPQLQueryBNF
representing a compound expression should be considered when doing the validation- Returns:
true
if theJPQLQueryBNF
is a descendant of the given parentJPQLQueryBNF
;false
otherwise
-
isValidProposal
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:
true
if the proposal is valid;false
otherwise
-
isValidVersion
Determines whether the given JPQL identifier can be a valid proposal, i.e. if it's part of the grammar of the JPA version that was used to parse the JPQL query.- Parameters:
identifier
- The JPQL identifier to validate- Returns:
true
if the given identifier is part of the current JPA version or was defined in previous release;false
otherwise
-
isWithinInvalidExpression
Determines whether the givenExpression
is part of an invalid fragment- Parameters:
expression
- TheExpression
to verify its location within the JPQL query- Returns:
true
if the givenExpression
is within an invalid fragment;false
if it is not
-
registerHelper
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:
-
removeVirtualSpace
protected final void removeVirtualSpace()Removes the last virtual space from the stack. -
toString
-
visit
Description copied from interface:ExpressionVisitor
Visits theAbsExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theAbstractSchemaName
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theAdditionExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theAllOrAnyExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theAndExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theArithmeticFactor
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theAvgFunction
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theBadExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theBetweenExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theCaseExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theCoalesceExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theCollectionExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theCollectionMemberDeclaration
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theCollectionMemberExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theCollectionValuedPathExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theComparisonExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theConcatExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theConstructorExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theCountFunction
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theDateTime
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theDeleteClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theDeleteStatement
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theDivisionExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theEmptyCollectionComparisonExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theEntityTypeLiteral
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theEntryExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theExistsExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from class:AnonymousExpressionVisitor
Blindly visit the givenExpression
.- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theFromClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theFunctionExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theGroupByClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theHavingClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theIdentificationVariable
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theIdentificationVariableDeclaration
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theIndexExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theInExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theInputParameter
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theJoin
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theJPQLExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theKeyExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theKeywordExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theLengthExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theLikeExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theLocalExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theLocalDateTime
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theLocateExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theLowerExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theMathDoubleExpression.Power
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theMathDoubleExpression.Round
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theMathSingleExpression.Ceiling
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theMathSingleExpression.Exp
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theMathSingleExpression.Floor
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theMathSingleExpression.Ln
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theMathSingleExpression.Sign
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theMaxFunction
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theMinFunction
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theModExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theMultiplicationExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theNotExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theNullComparisonExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theNullExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theNullIfExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theNumericLiteral
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theObjectExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theOnClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theOrderByClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theOrderByItem
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theOrExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theRangeVariableDeclaration
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theResultVariable
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theSelectClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theSelectStatement
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theSimpleFromClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theSimpleSelectClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theSimpleSelectStatement
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theSizeExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theSqrtExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theStateFieldPathExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theStringLiteral
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theSubExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theSubstringExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theSubtractionExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theSumFunction
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theTreatExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theTrimExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theTypeExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theUnknownExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheUnknownExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theUpdateClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheUpdateClause
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theUpdateItem
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheUpdateItem
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theUpdateStatement
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheUpdateStatement
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theUpperExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheUpperExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theValueExpression
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheValueExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theWhenClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheWhenClause
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theWhereClause
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheWhereClause
to visit
-
visitAggregateFunction
Visits the givenAggregateFunction
and attempts to find valid proposals.- Parameters:
expression
- TheAggregateFunction
to inspect
-
visitArithmeticExpression
Visits the givenArithmeticExpression
and attempts to find valid proposals.- Parameters:
expression
- TheArithmeticExpression
to inspect
-
visitCollectionExpression
protected <T extends Expression> void visitCollectionExpression(T expression, String identifier, AbstractContentAssistVisitor.CollectionExpressionHelper<T> helper) Adds the possible proposals for the givenexpression
based on the location of the cursor and the content of the expression.- Parameters:
expression
- Theexpression
being visitedidentifier
- The JPQL identifier of theExpression
being visited, if theExpression
does 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
-
visitEnumConstant
-
visitInvalidExpression
-
visitLogicalExpression
Visits the givenLogicalExpression
and attempts to find valid proposals.- Parameters:
expression
- TheLogicalExpression
to inspect
-
visitPathExpression
Visits the givenAbstractPathExpression
and 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
- TheAbstractPathExpression
to inspect
-
visitPathExpression
Visits the givenAbstractPathExpression
by attempting to resolve the path.- Parameters:
expression
- TheAbstractPathExpression
to inspectfilter
- TheFilter
is used to filter outIMapping
that 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 givenexpression
based on the location of the cursor and the content of the expression.- Parameters:
expression
- Theexpression
being visitedidentificationVariableType
- The type of identification variables that can be added as possible proposals
-
visitSingleEncapsulatedExpression
protected void visitSingleEncapsulatedExpression(AbstractSingleEncapsulatedExpression expression, AbstractContentAssistVisitor.IdentificationVariableType identificationVariableType, String... expressionIdentifiers) Adds the possible proposals for the givenexpression
based on the location of the cursor and the content of the expression.- Parameters:
expression
- Theexpression
being 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 givenAbstractSelectStatement
and checks to see if the identifiers of the following clauses can be added a valid proposals.- Parameters:
helper
- This helper handles one clause from the givenSELECT
statement
-
visitThirdPartyPathExpression
protected void visitThirdPartyPathExpression(AbstractPathExpression expression, String variableName) Visits the givenAbstractPathExpression
and 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
- TheAbstractPathExpression
to inspectvariableName
- The beginning of the path expression
-