Example:
// Have the external form of an IQuery
IQuery query = ...
// Create a JPQLQueryContext
JPQLQueryContext context = new JPQLQueryContext();
context.setQuery(query);
// Create a map of the positions within the parsed tree
QueryPosition queryPosition = context.getJPQLExpression().buildPosition(query.getExpression(), position);
// Either a real extension that adds additional support or
ContentAssistExtension extension = ContentAssistExtension.NULL_HELPER ;
// Create the visitor and visit the parsed tree
DefaultContentAssistVisitor visitor = new DefaultContentAssistVisitor(context);
visitor.buildProposals(queryPosition.getPosition(), extension) ;
queryPosition.getExpression().accept(visitor);
// Retrieve the proposals
ContentAssistProposals proposals = visitor.getProposals();
// Only required if the visitor is cached
visitor.dispose();
// Only required if the context is cached
context.dispose();
Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
| Modifier and Type | Class and Description |
|---|---|
| protected class | DefaultContentAssistVisitor.AcceptableTypeVisitor
The concrete instance that determines the return type of a function expression. |
| Access | Constructor and Description |
|---|---|
| public | DefaultContentAssistVisitor(JPQLQueryContext
The context used to query information about the query queryContext)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| protected DefaultContentAssistVisitor. | |
| protected JPQLGrammar | getLatestGrammar()
Implements abstract org. |
| protected boolean | isJoinFetchIdentifiable()
Implements abstract org. JOIN FETCH expression can be identified by with an
identification variable or not.
|
| DefaultContentAssistVisitor | back to summary |
|---|---|
| public DefaultContentAssistVisitor(JPQLQueryContext queryContext) Creates a new
| |
| buildAcceptableTypeVisitor | back to summary |
|---|---|
| protected DefaultContentAssistVisitor. Implements abstract org.
| |
| getLatestGrammar | back to summary |
|---|---|
| protected JPQLGrammar getLatestGrammar() Implements abstract org. Doc from org. 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.
| |
| isJoinFetchIdentifiable | back to summary |
|---|---|
| protected boolean isJoinFetchIdentifiable() Implements abstract org. Doc from org. Determines whether a
| |
| Access | Constructor and Description |
|---|---|
| protected |
| AcceptableTypeVisitor | back to summary |
|---|---|
| protected AcceptableTypeVisitor() | |
| visit | back to summary |
|---|---|
| public void visit(AbsExpression expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(ArithmeticFactor expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(AvgFunction expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(ConcatExpression expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(LengthExpression expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(LocateExpression expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(LowerExpression expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(ModExpression expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(SqrtExpression expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(SubstringExpression expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(SumFunction expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(TrimExpression expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(UpperExpression expression) Overrides org. Implements org. Doc from org. Visits the
| |