Top Description Inners Fields Constructors Methods
org.eclipse.persistence.jpa.jpql.tools

public abstract Class AbstractContentAssistVisitor

extends AnonymousExpressionVisitor
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.jpa.jpql.tools.DefaultContentAssistVisitor, org.eclipse.persistence.jpa.jpql.tools.EclipseLinkContentAssistVisitor
Annotations
@SuppressWarnings:nls, unused
Imports
java.util.ArrayList, .Collection, .Collections, .HashMap, .LinkedList, .List, .Locale, .Map, .Stack, org.eclipse.persistence.jpa.jpql.AbstractValidator.JPQLQueryBNFValidator, .Assert, .ExpressionTools, .JPAVersion, .JPQLQueryDeclaration.Type, .LiteralType, .WordParser, org.eclipse.persistence.jpa.jpql.parser.AbsExpression, .AbstractConditionalClause, .AbstractDoubleEncapsulatedExpression, .AbstractExpressionVisitor, .AbstractFromClause, .AbstractOrderByClause, .AbstractPathExpression, .AbstractSchemaName, .AbstractSelectClause, .AbstractSelectStatement, .AbstractSingleEncapsulatedExpression, .AbstractTraverseParentVisitor, .AbstractTripleEncapsulatedExpression, .AdditionExpression, .AggregateFunction, .AllOrAnyExpression, .AndExpression, .AnonymousExpressionVisitor, .ArithmeticExpression, .ArithmeticExpressionFactory, .ArithmeticFactor, .ArithmeticPrimaryBNF, .AvgFunction, .BadExpression, .BetweenExpression, .CaseExpression, .CaseOperandBNF, .CoalesceExpression, .CollectionExpression, .CollectionMemberDeclaration, .CollectionMemberExpression, .CollectionValuedPathExpression, .CollectionValuedPathExpressionBNF, .ComparisonExpression, .ComparisonExpressionFactory, .CompoundExpression, .ConcatExpression, .ConditionalExpressionBNF, .ConstructorExpression, .ConstructorItemBNF, .CountFunction, .DateTime, .DeleteClause, .DeleteStatement, .DivisionExpression, .EmptyCollectionComparisonExpression, .EntityTypeLiteral, .EntryExpression, .ExistsExpression, .Expression, .ExpressionFactory, .ExpressionVisitor, .FromClause, .FunctionExpression, .GroupByClause, .GroupByItemBNF, .HavingClause, .IdentificationVariable, .IdentificationVariableDeclaration, .IdentifierRole, .InExpression, .InExpressionItemBNF, .IndexExpression, .InputParameter, .InternalBetweenExpressionBNF, .InternalJoinBNF, .JPQLExpression, .JPQLGrammar, .JPQLQueryBNF, .Join, .KeyExpression, .KeywordExpression, .LengthExpression, .LikeExpression, .LocalDateTime, .LocalExpression, .LocateExpression, .LogicalExpression, .LowerExpression, .MathDoubleExpression, .MathSingleExpression, .MaxFunction, .MinFunction, .ModExpression, .MultiplicationExpression, .NewValueBNF, .NotExpression, .NullComparisonExpression, .NullExpression, .NullIfExpression, .NumericLiteral, .ObjectExpression, .OnClause, .OrExpression, .OrderByClause, .OrderByItem, .OrderByItem.Ordering, .OrderByItemBNF, .QueryPosition, .RangeVariableDeclaration, .RangeVariableDeclarationBNF, .ResultVariable, .ScalarExpressionBNF, .SelectClause, .SelectStatement, .SimpleFromClause, .SimpleSelectClause, .SimpleSelectStatement, .SizeExpression, .SqrtExpression, .StateFieldPathExpression, .StringLiteral, .StringPrimaryBNF, .SubExpression, .SubqueryBNF, .SubstringExpression, .SubtractionExpression, .SumFunction, .TreatExpression, .TrimExpression, .TypeExpression, .UnknownExpression, .UpdateClause, .UpdateItem, .UpdateStatement, .UpperExpression, .ValueExpression, .WhenClause, .WhereClause, org.eclipse.persistence.jpa.jpql.tools.ContentAssistProposals.ClassType, org.eclipse.persistence.jpa.jpql.tools.resolver.Declaration, .Resolver, .StateFieldResolver, org.eclipse.persistence.jpa.jpql.tools.spi.IEntity, .IManagedType, .IMapping, .IType, org.eclipse.persistence.jpa.jpql.tools.utility.filter.AndFilter, org.eclipse.persistence.jpa.jpql.utility.CollectionTools, org.eclipse.persistence.jpa.jpql.utility.filter.Filter, .NullFilter

The visitor provides support for finding the possible proposals within a JPQL query at a certain position.

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

Author
Pascal Filion

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
protected abstract static class
AbstractContentAssistVisitor.AbstractConditionalClauseCollectionHelper<T extends Expression>

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 abstract static class
protected abstract static class
protected abstract static class
protected abstract static class
protected abstract static class
private abstract static class
AbstractContentAssistVisitor.AbstractVisitorHelper

Common helper with visitor reference.

protected abstract static class
protected abstract static class
AbstractContentAssistVisitor.AcceptableTypeVisitor

This visitor retrieves the permitted type from the path expression's parent.

protected static class
AbstractContentAssistVisitor.AppendableExpressionVisitor

This visitor scans the visited Expression 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
AbstractContentAssistVisitor.AppendableType

This is used to determine how AppendableExpressionVisitor should perform the check.

protected static interface
AbstractContentAssistVisitor.CollectionExpressionHelper<T extends Expression>

This helper is used to determine how to add proposals within a collection of expressions.

protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
AbstractContentAssistVisitor.DefaultMappingCollector

The default implementation of MappingCollector, which simply returns an empty collection.

protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
AbstractContentAssistVisitor.EndingQueryPositionBuilder

This builder populates a QueryPosition by traversing the valid portion of the JPQL query.

protected static class
AbstractContentAssistVisitor.EnumVisitor

This visitor determines whether a path expression can be resolved as a fully qualified enum type and an enum constant.

protected static class
AbstractContentAssistVisitor.FilteringMappingCollector

This MappingCollector returns the possible mappings (non-collection type or collection type) from a managed type.

protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static enum
AbstractContentAssistVisitor.IdentificationVariableType

The various ways of retrieving identification variables from the declaration expression.

protected static class
AbstractContentAssistVisitor.IncompleteCollectionExpressionVisitor

This visitor is used when a clause or a compound expression was parsed with a collection of expressions representing an invalid fragment.

protected static class
AbstractContentAssistVisitor.InvalidExpressionVisitor

This visitor determines if the visited Expression is one of the two that represents an invalid expression.

protected static class
protected static interface
AbstractContentAssistVisitor.MappingCollector

A collector is responsible to retrieve the possible proposals by using the mappings that can complete a path expression.

protected static class
AbstractContentAssistVisitor.MappingFilterBuilder

This visitor is responsible to create the right Filter based on the type of the Expression.

protected static class
AbstractContentAssistVisitor.MappingTypeFilter

This Filter is responsible to filter out the mappings that can't have their type assignable to the one passed in.

protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static interface
AbstractContentAssistVisitor.StatementHelper<T extends Expression>

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 class
protected static class
AbstractContentAssistVisitor.SubqueryVisitor

This visitor determines if an Expression is in a subquery.

protected static class
protected static class
protected static class
protected static class
AbstractContentAssistVisitor.VisitParentVisitor

This visitor is meant to adjust the corrections stack when traversing an Expression in order to increase the list of valid proposals.

protected static class
protected static class
protected static class
protected static class
protected static class

Field Summary

Modifier and TypeField and Description
protected Stack<Integer>
corrections

This is used to change the position of the cursor in order to add possible proposals

protected Map<Class<?>, Object>
helpers

The cached helpers that are used by this visitor to add valid content assist proposals.

protected Map<String, Filter<Expression>>
identifierFilters

This map contains the Filter 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>
INVALID_IDENTIFIER_FILTER

This Filter is used to say the Expression is invalid without doing anything.

protected Stack<Expression>
lockedExpressions

Used to prevent and infinite recursion when one of the visit method is virtually asking a child expression to be visited.

protected DefaultContentAssistProposals
proposals

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

protected final JPQLQueryContext
queryContext

The context used to query information about the JPQL query.

protected QueryPosition
queryPosition

Contains the position of the cursor within the parsed Expression from the root node up to the deepest leaf node.

protected static final int
SPACE_LENGTH

A constant for the length of a whitespace, which is 1.

protected static final Filter<Expression>
VALID_IDENTIFIER_FILTER

This Filter is used to say the Expression is valid without doing anything.

protected Stack<Integer>
virtualSpaces

A virtual space is used to move the position of the cursor by adding an extra space in order to find some proposals within an expression.

protected String
word

The current word, which was retrieved from the JPQL query based on the position of the cursor.

protected WordParser
wordParser

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

Constructor Summary

AccessConstructor and Description
protected
AbstractContentAssistVisitor(JPQLQueryContext
The context used to query information about the JPQL query
queryContext
)

Creates a new AbstractContentAssistVisitor.

Method Summary

Modifier and TypeMethod and Description
protected void
addAggregateIdentifier(String
The JPQL identifier to add as a valid proposal if it passes the checks
identifier
)

Adds the given JPQL identifier as a valid proposal if its role is IdentifierRole#AGGREGATE and the beginning starts with the current word.

protected void
addAggregateIdentifiers(JPQLQueryBNF
The JPQLQueryBNF for which the registered JPQL identifiers will be added as proposals if they pass the checks
queryBNF
)

Adds the JPQL identifiers that are registered with the given JPQLQueryBNF as valid proposals if their role is IdentifierRole#AGGREGATE and the beginning starts with the current word.

protected void
addAggregateIdentifiers(String
The unique of the JPQLQueryBNF for which the registered JPQL identifiers will be added as proposals if they pass the checks
queryBNFId
)

Adds the JPQL identifiers that are registered with the given JPQLQueryBNF as valid proposals if their role is IdentifierRole#AGGREGATE and the beginning starts with the current word.

protected void
addArithmeticIdentifiers()

Adds the JPQL identifiers which correspond to the arithmetic operators as valid proposals.

protected void
addClauseIdentifier(String
The JPQL identifier to add as a valid proposal if it passes the checks
identifier
)

Adds the given JPQL identifier as a valid proposal if its role is IdentifierRole#CLAUSE and the beginning starts with the current word.

protected void
addClauseIdentifiers(JPQLQueryBNF
The JPQLQueryBNF for which the registered JPQL identifiers will be added as proposals if they pass the checks
queryBNF
)

Adds the JPQL identifiers that are registered with the given JPQLQueryBNF as valid proposals if their role is IdentifierRole#CLAUSE and the beginning starts with the current word.

protected void
addClauseIdentifiers(String
The unique identifier of the JPQLQueryBNF for which the registered JPQL identifiers will be added as proposals if they pass the checks
queryBNFId
)

Adds the JPQL identifiers that are registered with the given JPQLQueryBNF as valid proposals if their role is IdentifierRole#CLAUSE and the beginning starts with the current word.

protected void
addComparisonIdentifiers(Expression
The Expression is preceding the position of the cursor and will help to determine which of the comparison operators are valid
expression
)

Adds the JPQL identifiers which correspond to the comparison operators as valid proposals.

protected void
addCompositeIdentifier(String
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
identifier
,
int
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
offset
)

Adds the composite JPQL identifier by following the given rules:

  • If the word is empty and the offset is -1, then use the rule used by addIdentifier(String);
  • Otherwise checks the ending of the JPQL query with a portion of the identifier from the entire length of the identifier to the given offset by cutting off the trailing characters.
protected void
addCompoundIdentifier(String
The JPQL identifier to add as a valid proposal if it passes the checks
identifier
,
Expression
The Expression represents the fragment that is before the current word and it helps to filter out some of the compound identifiers
expression
,
boolean
Flag indicating if the IS identifier was found before the word, which would also be before the NOT identifier if it was also found
hasIs
,
boolean
Flag indicating if the NOT identifier was found before the word
hasNot
)

Adds the given JPQL identifier as a valid proposal if its role is IdentifierRole#COMPOUND_FUNCTION and the beginning starts with the current word.

protected void
addCompoundIdentifiers(JPQLQueryBNF
The JPQLQueryBNF for which the registered JPQL identifiers will be added as proposals if they pass the checks
queryBNF
,
Expression
The Expression represents the fragment that is before the current word and it helps to filter out some of the compound identifiers
expression
,
boolean
Flag indicating if the IS identifier was found before the word, which would also be before the NOT identifier if it was also found
hasIs
,
boolean
Flag indicating if the NOT identifier was found before the word
hasNot
)

Adds the JPQL identifiers that are registered with the given JPQLQueryBNF as valid proposals if their role is IdentifierRole#COMPOUND_FUNCTION and the beginning starts with the current word.

protected void
addCompoundIdentifiers(String
The unique identifier of the JPQLQueryBNF for which the registered JPQL identifiers will be added as proposals if they pass the checks
queryBNFId
,
Expression
The Expression represents the fragment that is before the current word and it helps to filter out some of the compound identifiers
expression
,
boolean
Flag indicating if the IS identifier was found before the word, which would also be before the NOT identifier if it was also found
hasIs
,
boolean
Flag indicating if the NOT identifier was found before the word
hasNot
)

Adds the JPQL identifiers that are registered with the given JPQLQueryBNF as valid proposals if their role is IdentifierRole#COMPOUND_FUNCTION and the beginning starts with the current word.

protected void
addEntities()

Adds the entities as possible content assist proposals but will be filtered using the current word.

protected void
addEntities(IType
The IType used to filter the abstract schema types
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 given IType.

protected void
addEnumConstant(IType
The IType of the Enum
enumType
,
String
The enum constant to be added as a valid proposal
enumConstant
)

Adds the given enum constant as a valid proposal.

protected void
addEnumConstants(IType
The IType of the enum type
enumType
,
String
The word is used to filter the enum constants, which can be null or an empty string
word
)

Adds the constants of the given enum type as valid proposals if the beginning starts with the given word.

protected void
addExpressionFactoryIdentifiers(ExpressionFactory
The factory for which its registered JPQL identifiers are added as valid proposals, if they meet the checks
expressionFactory
)

Adds the JPQL identifiers that were registered with the given ExpressionFactory.

protected void
addExpressionFactoryIdentifiers(String
The unique identifier of the factory for which its registered JPQL identifiers are added as valid proposals, if they meet the checks
expressionFactoryId
)

Adds the JPQL identifiers that were registered with the ExpressionFactory with the given unique identifier.

protected void
addFunctionIdentifier(String
The JPQL identifier to add as a valid proposal if it passes the checks
identifier
)

Adds the given JPQL identifier as a valid proposal if its role is IdentifierRole#FUNCTION and the beginning starts with the current word.

protected void
addFunctionIdentifiers(Expression
The Expression is used to determine the JPQLQueryBNF to use when retrieving the JPQL identifiers representing a function
expression
)

Adds the JPQL identifiers for which their role is FUNCTION by determining the JPQLQueryBNF that represents the fragment for which the given Expression was parsed.

protected void
addFunctionIdentifiers(JPQLQueryBNF
The JPQLQueryBNF for which the registered JPQL identifiers will be added as proposals if they pass the checks
queryBNF
)

Adds the JPQL identifiers that are registered with the given JPQLQueryBNF as valid proposals if their role is IdentifierRole#FUNCTION and the beginning starts with the current word.

protected void
addFunctionIdentifiers(String
The unique identifier of the JPQLQueryBNF for which the registered JPQL identifiers will be added as proposals if they pass the checks
queryBNFId
)

Adds the JPQL identifiers that are registered with the given JPQLQueryBNF as valid proposals if their role is IdentifierRole#FUNCTION and the beginning starts with the current word.

protected void
addIdentificationVariable(String
The identification variable to add as a proposal if it passes the checks
identificationVariable
)

Adds the given identification variable as a valid proposal.

protected void
addIdentificationVariables()

Adds all the identification variables defined in the current query's FROM clause.

protected void
addIdentificationVariables(Expression
The Expression where the content assist was invoked, which helps to determine how to stop adding identification variables
expression
,
AbstractContentAssistVisitor.IdentificationVariableType
Which type of identification variables to add as valid proposals
type
)

Adds the possible identification variables as valid proposals but filter them based on the given type.

protected void
addIdentifier(String
The JPQL identifier to add as a proposal
identifier
)

Adds the given identifier as a proposal if it passes the checks.

protected void
addJoinIdentifiers()

Adds the join specification identifiers as proposals.

protected void
addLeftIdentificationVariables(Expression
The Expression used to determine at which declaration to stop
expression
)

Adds the identification variables defined in the current query's FROM clause that are declared before the given Expression.

protected void
addLogicalIdentifiers()

Adds the logical identifiers, which are AND and OR.

protected void
addRangeIdentificationVariable(String
An identification variable that is
identificationVariable
)

Adds the given identification variable as a proposal if it passes the checks.

protected void
addResultVariables()

Adds the result variables defined in the SELECT clause as valid proposals.

protected final void
addVirtualSpace()

Adds a virtual space on the stack.

protected boolean

Returns:

true if the operators are appendable; false otherwise
areArithmeticSymbolsAppendable
(Expression
The Expression that found left of the cursor, which determines if the arithmetic operators are appendable or not
expression
)

Determines whether the given Expression can be followed by an arithmetic operator.

protected boolean

Returns:

true if the operators are appendable; false otherwise
areComparisonSymbolsAppendable
(Expression
The Expression that found left of the cursor, which determines if the comparison operators are appendable or not
expression
)

Determines whether the given Expression can be followed by a comparison operator.

protected boolean

Returns:

true if the logical identifiers are appendable; false otherwise
areLogicalSymbolsAppendable
(Expression
The Expression that found left of the cursor, which determines if the logical operators are appendable or not
expression
)

Determines whether the given Expression can be followed by a logical operator.

protected abstract AbstractContentAssistVisitor.AcceptableTypeVisitor
protected AbstractContentAssistVisitor.AppendableExpressionVisitor
protected Filter<Expression>
protected AbstractContentAssistVisitor.CollectionExpressionVisitor
protected AbstractContentAssistVisitor.CollectionMappingFilter
protected AbstractContentAssistVisitor.ConcatExpressionCollectionHelper
protected AbstractContentAssistVisitor.ConditionalClauseCollectionHelper
protected AbstractContentAssistVisitor.ConstrutorCollectionHelper
protected AbstractContentAssistVisitor.DeclarationVisitor
protected AbstractContentAssistVisitor.DefaultMappingCollector
protected AbstractContentAssistVisitor.DeleteClauseCollectionHelper
protected AbstractContentAssistVisitor.DeleteClauseStatementHelper
protected Filter<Expression>
protected AbstractContentAssistVisitor.DoubleEncapsulatedCollectionHelper
protected AbstractContentAssistVisitor.EncapsulatedExpressionVisitor
protected QueryPosition

Returns:

The new QueryPosition that contains the position of the cursor starting from the given Expression down to the right leaf
buildEndingPositionFromInvalidExpression
(Expression
The invalid Expression for which a new QueryPosition will be calculated
invalidExpression
,
Expression
The Expression from which the calculation of the positions will start
startingPointExpression
,
boolean[]
Single element array that will be used to store the flag indicating if a virtual space should be added or not
virtualSpace
)

Creates a new QueryPosition containing the corrected positions starting at the given Expression and traversing the children at is always at the right side of the tree.

protected AbstractContentAssistVisitor.EndingQueryPositionBuilder
protected AbstractContentAssistVisitor.EnumVisitor
protected AbstractContentAssistVisitor.FilteringMappingCollector
protected AbstractContentAssistVisitor.FollowingClausesVisitor
protected AbstractContentAssistVisitor.FollowingInvalidExpressionVisitor
protected AbstractContentAssistVisitor.FromClauseCollectionHelper
protected AbstractContentAssistVisitor.FromClauseStatementHelper
protected AbstractContentAssistVisitor.GroupByClauseCollectionHelper
protected AbstractContentAssistVisitor.GroupByClauseStatementHelper
protected AbstractContentAssistVisitor.HavingClauseStatementHelper
protected AbstractContentAssistVisitor.IncompleteCollectionExpressionVisitor
protected AbstractContentAssistVisitor.InvalidExpressionVisitor
protected AbstractContentAssistVisitor.JoinCollectionHelper
protected AbstractValidator.JPQLQueryBNFValidator

Returns:

A JPQLQueryBNFValidator that can determine if an Expression follows the given BNF
buildJPQLQueryBNFValidator
(JPQLQueryBNF
The BNF used to determine the validity of an Expression
queryBNF
)

Returns the JPQLQueryBNFValidator that can be used to validate an Expression by making sure its BNF is part of the given BNF.

protected AbstractContentAssistVisitor.MappingCollector
protected Filter<IMapping>
protected Filter<IMapping>
protected AbstractContentAssistVisitor.MappingFilterBuilder
protected Filter<Expression>
protected AbstractContentAssistVisitor.NotExpressionVisitor
protected AbstractContentAssistVisitor.OrderByClauseCollectionHelper
protected AbstractContentAssistVisitor.OrderByClauseStatementHelper
protected AbstractContentAssistVisitor.PropertyMappingFilter
public ContentAssistProposals

Returns:

The proposals that are valid choices for the given position
buildProposals
(int
The position of the cursor within the JPQL query
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.

public ContentAssistProposals

Returns:

The proposals that are valid choices for the given position
buildProposals
(int
The position of the cursor within the JPQL query
position
,
ContentAssistExtension
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
extension
)

Prepares this visitor by prepopulating it with the necessary data that is required to properly gather the list of proposals based on the given caret position.

protected AbstractContentAssistVisitor.RangeVariableDeclarationVisitor
protected AbstractContentAssistVisitor.ResultVariableVisitor
protected AbstractContentAssistVisitor.SelectClauseCollectionHelper
protected AbstractContentAssistVisitor.SelectClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleFromClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleGroupByClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleHavingClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleSelectClauseCollectionHelper
protected AbstractContentAssistVisitor.SimpleSelectClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleWhereClauseSelectStatementHelper
protected AbstractContentAssistVisitor.SubqueryAppendableExpressionVisitor
protected AbstractContentAssistVisitor.SubqueryVisitor
protected AbstractContentAssistVisitor.TripleEncapsulatedCollectionHelper
protected AbstractContentAssistVisitor.UpdateClauseStatementHelper
protected AbstractContentAssistVisitor.UpdateItemCollectionHelper
protected AbstractContentAssistVisitor.VisitParentVisitor
protected AbstractContentAssistVisitor.WhenClauseConditionalClauseCollectionHelper
protected AbstractContentAssistVisitor.WhereClauseDeleteStatementHelper
protected AbstractContentAssistVisitor.WhereClauseSelectStatementHelper
protected AbstractContentAssistVisitor.WhereClauseUpdateStatementHelper
protected AbstractContentAssistVisitor.WithinInvalidExpressionVisitor
public void
dispose()

Disposes of the internal data.

protected RangeVariableDeclaration

Returns:

Either the RangeVariableDeclaration if the JPQL query defines it or null if it was not defined
findRangeVariableDeclaration
(UpdateClause expression)

Retrieves the RangeVariableDeclaration that defines the entity name and identification variable for the given UpdateClause.

protected IType

Returns:

The root IType allowed or null if anything is allowed
getAcceptableType
(Expression
The Expression to visit, including its parent hierarchy until an Expression requires a certain IType
expression
)

Determines the root IType that any type should be assignable.

protected AbstractContentAssistVisitor.AppendableExpressionVisitor
protected CollectionExpression

Returns:

The given Expression if it is a CollectionExpression or null if it is any other object
getCollectionExpression
(Expression
The Expression to cast
expression
)

Casts the given Expression to a CollectionExpression if it is actually an object of that type.

protected AbstractContentAssistVisitor.CollectionExpressionVisitor
getCollectionExpressionVisitor()

Returns the visitor that collects the CollectionExpression if it's been visited.

protected AbstractContentAssistVisitor.ConcatExpressionCollectionHelper
protected AbstractContentAssistVisitor.ConditionalClauseCollectionHelper
protected AbstractContentAssistVisitor.ConstrutorCollectionHelper
protected AbstractContentAssistVisitor.DeclarationVisitor
protected AbstractContentAssistVisitor.MappingCollector
protected AbstractContentAssistVisitor.DeleteClauseCollectionHelper
protected AbstractContentAssistVisitor.DeleteClauseStatementHelper
protected AbstractContentAssistVisitor.DoubleEncapsulatedCollectionHelper
protected AbstractContentAssistVisitor.EncapsulatedExpressionVisitor
protected AbstractContentAssistVisitor.EndingQueryPositionBuilder
protected AbstractContentAssistVisitor.EnumVisitor
protected ExpressionFactory

Returns:

The ExpressionFactory mapped with the given unique identifier
getExpressionFactory
(String
The unique identifier of the ExpressionFactory to retrieve
expressionFactoryId
)

Retrieves the registered ExpressionFactory that was registered for the given unique identifier.

protected AbstractContentAssistVisitor.AcceptableTypeVisitor
protected Filter<Expression>
getFilter(String identifier)

protected AbstractContentAssistVisitor.FollowingClausesVisitor
protected AbstractContentAssistVisitor.FollowingInvalidExpressionVisitor
protected AbstractContentAssistVisitor.FromClauseCollectionHelper
protected AbstractContentAssistVisitor.FromClauseStatementHelper
protected AbstractContentAssistVisitor.GroupByClauseCollectionHelper
protected AbstractContentAssistVisitor.GroupByClauseStatementHelper
protected AbstractContentAssistVisitor.HavingClauseStatementHelper
protected final <T> T

Returns:

The helper being requested
getHelper
(Class<T>
The Java class of the helper to retrieve
helperClass
)

Retrieves the helper associated with the given helper class.

protected IdentifierRole

Returns:

The role of the given identifier
getIdentifierRole
(String
The identifier for which its role is requested
identifier
)

Retrieves the role of the given identifier.

protected AbstractContentAssistVisitor.IncompleteCollectionExpressionVisitor
protected AbstractContentAssistVisitor.InvalidExpressionVisitor
protected AbstractContentAssistVisitor.JoinCollectionHelper
protected abstract JPQLGrammar

Returns:

The latest JPQLGrammar supported by the provider
getLatestGrammar
()

Returns the latest supported JPQL grammar, which is required when checking the validity of a JPQL identifier.

protected Filter<IMapping>
protected AbstractContentAssistVisitor.MappingFilterBuilder
protected Filter<IMapping>
protected AbstractContentAssistVisitor.NotExpressionVisitor
protected AbstractContentAssistVisitor.OrderByClauseCollectionHelper
protected AbstractContentAssistVisitor.OrderByClauseStatementHelper
protected JPQLQueryBNF

Returns:

The JPQLQueryBNF representing a section of the grammar
getQueryBNF
(String
The unique identifier of the JPQLQueryBNF to retrieve
queryBNFId
)

Retrieves the JPQLQueryBNF that was registered for the given unique identifier.

protected AbstractContentAssistVisitor.RangeVariableDeclarationVisitor
protected AbstractContentAssistVisitor.ResultVariableVisitor
protected AbstractContentAssistVisitor.SelectClauseCollectionHelper
protected AbstractContentAssistVisitor.SelectClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleFromClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleGroupByClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleHavingClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleSelectClauseCollectionHelper
protected AbstractContentAssistVisitor.SimpleSelectClauseStatementHelper
protected AbstractContentAssistVisitor.SimpleWhereClauseSelectStatementHelper
protected AbstractContentAssistVisitor.SubqueryAppendableExpressionVisitor
protected AbstractContentAssistVisitor.SubqueryVisitor
protected AbstractContentAssistVisitor.TripleEncapsulatedCollectionHelper
protected AbstractContentAssistVisitor.UpdateClauseStatementHelper
protected AbstractContentAssistVisitor.UpdateItemCollectionHelper
protected AbstractContentAssistVisitor.VisitParentVisitor
protected AbstractContentAssistVisitor.WhenClauseConditionalClauseCollectionHelper
protected AbstractContentAssistVisitor.WhereClauseDeleteStatementHelper
protected AbstractContentAssistVisitor.WhereClauseSelectStatementHelper
protected AbstractContentAssistVisitor.WhereClauseUpdateStatementHelper
protected AbstractContentAssistVisitor.WithinInvalidExpressionVisitor
protected boolean
hasClausesDefinedBetween(Expression expression, String afterIdentifier, String beforeIdentifier)

protected final boolean

Returns:

true if there is a virtual space to count as a real one or not
hasVirtualSpace
()

Determines whether there is a virtual space to be considered or not.

protected void
initialize()

Initializes this visitor.

protected boolean

Returns:

true if the given identifier is used in an aggregate expression; false otherwise
isAggregate
(String
The identifier to validate
identifier
)

Determines whether the given JPQL identifier used in an aggregate expression; for instance AND.

protected boolean

Returns:

true if the JPQL identifiers with the given type can be appended to the JPQL query; false if they cannot
isAppendable
(Expression
The Expression that determines what can be appended
expression
,
AbstractContentAssistVisitor.AppendableType
The type of identifiers to append to the JPQL query
appendableType
)

Determines whether a certain type of JPQL identifiers can be appended to the JPQL query based on the given Expression.

protected boolean
isAppendableToCollection(Expression expression)

Determines whether

protected boolean

Returns:

true if the given identifier is a clause; false otherwise
isClause
(String
The identifier to validate
identifier
)

Determines whether the given JPQL identifier used in a clause; for instance SELECT.

protected boolean

Returns:

true if the following clauses can be appended to the JPQL query; false if they cannot
isClauseAppendable
(Expression
The Expression that determines what can be appended
expression
)

Determines whether the identifiers identifying clauses can be appended to the JPQL query based on the given Expression.

protected boolean

Returns:

true if the Expression is grammatically complete; false otherwise
isComplete
(Expression
The Expression to verify its grammar integrity
expression
)

Determines whether the given Expression is grammatically complete.

protected boolean

Returns:

true if the compound identifiers can be appended to the JPQL query; false if they cannot
isCompoundable
(Expression
The Expression that determines if the JPQL identifiers with IdentifierRole#COMPOUND_FUNCTION can be used to create a compound expression
expression
)

Determines whether the given Expression can be used as the left side of a compound expression.

protected boolean

Returns:

true if the given identifier is used in a compound expression; false otherwise
isCompoundFunction
(String
The identifier to validate
identifier
)

Determines whether the given JPQL identifier used in a compound expression; an example would be BETWEEN or MEMBER.

protected boolean

Returns:

true if the visited CollectionValuedPathExpression is owned by a RangeVariableDeclaration, which indicates it is used to define the "root" object; false if it is not
isDeclaration
(AbstractPathExpression expression)

Determines whether the given AbstractPathExpression is found within a declaration expression.

protected boolean

Returns:

true if the given Expression is within parenthesis; false otherwise
isEncapsulated
(Expression
The Expression to scan for encapsulation
expression
)

Determines whether the given Expression is being encapsulated or not.

protected boolean

Returns:

true if the path expression represents a enum constant; false otherwise
isEnumAllowed
(AbstractPathExpression expression)

Determines whether the given AbstractPathExpression could potentially represent a fully qualified enum constant, which is dictated by the location of the path expression within the query.

protected boolean

Returns:

true if the visited Expression is part of a collection of expressions and an invalid expression precede it; false otherwise
isFollowingInvalidExpression
(Expression
The Expression to visit
expression
)

Determines whether the given Expression is preceded by an invalid expression.

protected boolean

Returns:

true if the given identifier is a function; false otherwise
isFunction
(String
The identifier to validate
identifier
)

Determines whether the given JPQL identifier is a function, an example would be AVG.

protected boolean

Returns:

true if the owning query is a subquery; false if it's the top-level query
isInSubquery
(Expression
The Expression to visit its parent hierarchy
expression
)

Determines whether the given Expression is in a subquery or in the top-level query.

protected boolean

Returns:

true if the Expression is an invalid fragment; false otherwise
isInvalidExpression
(Expression
The Expression to visit
expression
)

Determines whether the given Expression represents an invalid fragment.

protected abstract boolean

Returns:

true if the expression can have an identification variable; false otherwise
isJoinFetchIdentifiable
()

Determines whether a JOIN FETCH expression can be identified by with an identification variable or not.

protected boolean

Returns:

true if the given Expression has been marked as locked; false otherwise
isLocked
(Expression
The Expression to check if it is locked
expression
)

Determines whether the given Expression has been set has the lock to prevent an infinite recursion.

protected boolean

Returns:

true if the Expression is NotExpression; false otherwise
isNotExpression
(Expression
The Expression to visit
expression
)

Determines whether the given Expression represents the negated expression.

protected boolean

Returns:

true if the given position is within the given word; false otherwise
isPositionWithin
(int
The position of the cursor
position
,
int
The offset to adjust the position
offset
,
String
The word to check if the cursor is positioned in it
word
)

Determines whether the given position is within the given word.

protected boolean

Returns:

true if the given position is within the given word; false otherwise
isPositionWithin
(int
The position of the cursor
position
,
String
The word to check if the cursor is positioned in it
word
)

Determines whether the given position is within the given word.

protected boolean

Returns:

true if a subquery can be appended; false otherwise
isSubqueryAppendable
(Expression
The Expression that precedes the position of the cursor
expression
)

Determines whether the JPQL identifier starting a subquery (SELECT) can be appended based on the given Expression which is preceding the position of the cursor.

protected boolean

Returns:

true if the Expression part is a child of the given query BNF; false otherwise
isValid
(Expression
The Expression to validate based on the query BNF
expression
,
JPQLQueryBNF queryBNF)

Determines whether the given Expression part is an expression of the given query BNF.

protected boolean

Returns:

true if the Expression part is a child of the given query BNF; false otherwise
isValid
(Expression
The Expression to validate based on the query BNF
expression
,
String queryBNFId)

Determines whether the given Expression part is an expression of the given query BNF.

protected boolean

Returns:

true if the JPQLQueryBNF is a descendant of the given parent JPQLQueryBNF; false otherwise
isValid
(JPQLQueryBNF
The "root" of the BNF used to determine if the other is a descendant
parentQueryBNF
,
JPQLQueryBNF
The BNF to check if it is a descendant of the parent
queryBNF
)

Determines whether the given JPQLQueryBNF part is the given parent JPQLQueryBNF.

protected boolean

Returns:

true if the JPQLQueryBNF is a descendant of the given parent JPQLQueryBNF; false otherwise
isValid
(JPQLQueryBNF
The "root" of the BNF used to determine if the other is a descendant
parentQueryBNF
,
JPQLQueryBNF
The BNF to check if it is a descendant of the parent
queryBNF
,
boolean
Indicates whether a JPQLQueryBNF representing a compound expression should be considered when doing the validation
bypassCompound
)

Determines whether the given JPQLQueryBNF part is the given parent JPQLQueryBNF.

protected boolean

Returns:

true if the JPQLQueryBNF is a descendant of the given parent JPQLQueryBNF; false otherwise
isValid
(JPQLQueryBNF
The "root" of the BNF used to determine if the other is a descendant
parentQueryBNF
,
String
The unique identifier of the JPQLQueryBNF to check if it is a descendant of the parent
queryBNFId
,
boolean
Indicates whether a JPQLQueryBNF representing a compound expression should be considered when doing the validation
bypassCompound
)

Determines whether the given JPQLQueryBNF part is the given parent JPQLQueryBNF.

protected boolean

Returns:

true if the proposal is valid; false otherwise
isValidProposal
(String
The proposal to validate
proposal
,
String
The word, which is what was parsed before the position of the cursor
word
)

Determines whether the given proposal is a valid, which is based on the content of the given word.

protected boolean

Returns:

true if the given identifier is part of the current JPA version or was defined in previous release; false otherwise
isValidVersion
(String
The JPQL identifier to validate
identifier
)

Determines whether the given JPQL identifier can be a valid proposal, i.e. if it's part of the grammar of the JPA version that was used to parse the JPQL query.

protected boolean

Returns:

true if the given Expression is within an invalid fragment; false if it is not
isWithinInvalidExpression
(Expression
The Expression to verify its location within the JPQL query
expression
)

Determines whether the given Expression is part of an invalid fragment

protected final <T> void
registerHelper(Class<T>
The Java class of the helper to retrieve
helperClass
,
T
The helper being registered
helper
)

Registers the given helper associated with the given helper class.

protected final void
removeVirtualSpace()

Removes the last virtual space from the stack.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
protected void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
protected void
visitAggregateFunction(AggregateFunction
The AggregateFunction to inspect
expression
)

Visits the given AggregateFunction and attempts to find valid proposals.

protected void
visitArithmeticExpression(ArithmeticExpression
The ArithmeticExpression to inspect
expression
)

Visits the given ArithmeticExpression and attempts to find valid proposals.

protected <T extends Expression> void
visitCollectionExpression(T
The expression being visited
expression
,
String
The JPQL identifier of the Expression being visited, if the Expression does not have an identifier, than an empty string should be passed
identifier
,
AbstractContentAssistVisitor.CollectionExpressionHelper<T>
This helper completes the behavior of this method by retrieving the information from the given Expression
helper
)

Adds the possible proposals for the given expression based on the location of the cursor and the content of the expression.

protected void
protected void
protected void
protected void
visitLogicalExpression(LogicalExpression
The LogicalExpression to inspect
expression
)

Visits the given LogicalExpression and attempts to find valid proposals.

protected void
visitPathExpression(AbstractPathExpression
The AbstractPathExpression to inspect
expression
)

Visits the given AbstractPathExpression and attempts to find valid proposals.

protected void
visitPathExpression(AbstractPathExpression
The AbstractPathExpression to inspect
expression
,
Filter<IMapping>
The Filter is used to filter out IMapping that are not valid based on their type and the type that is allowed
filter
)

Visits the given AbstractPathExpression by attempting to resolve the path.

protected void
visitSingleEncapsulatedExpression(AbstractSingleEncapsulatedExpression
The expression being visited
expression
,
AbstractContentAssistVisitor.IdentificationVariableType
The type of identification variables that can be added as possible proposals
identificationVariableType
)

Adds the possible proposals for the given expression based on the location of the cursor and the content of the expression.

protected void
visitSingleEncapsulatedExpression(AbstractSingleEncapsulatedExpression
The expression being visited
expression
,
AbstractContentAssistVisitor.IdentificationVariableType
The type of identification variables that can be added as possible proposals
identificationVariableType
,
String...
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
expressionIdentifiers
)

Adds the possible proposals for the given expression based on the location of the cursor and the content of the expression.

protected <T extends Expression> void
visitStatement(T expression, AbstractContentAssistVisitor.StatementHelper<T>
This helper handles one clause from the given SELECT statement
helper
)

Visits the given AbstractSelectStatement and checks to see if the identifiers of the following clauses can be added a valid proposals.

protected void
visitThirdPartyPathExpression(AbstractPathExpression
The AbstractPathExpression to inspect
expression
,
String
The beginning of the path expression
variableName
)

Visits the given AbstractPathExpression and attempts to find valid proposals that is not provided by the default implementation.