|
EclipseLink 2.5.3, build 'v20180808-e38c757' API Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
org.eclipse.persistence.jpa.jpql.tools.AbstractContentAssistVisitor
org.eclipse.persistence.jpa.jpql.tools.DefaultContentAssistVisitor
public class DefaultContentAssistVisitor
This visitor traverses the JPQL parsed tree and gathers the possible proposals at a given position.
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.prepare(queryPosition, 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.
| Nested Class Summary | |
|---|---|
protected class |
DefaultContentAssistVisitor.AcceptableTypeVisitor
The concrete instance that determines the return type of a function expression. |
| Field Summary |
|---|
| Fields inherited from class org.eclipse.persistence.jpa.jpql.tools.AbstractContentAssistVisitor |
|---|
corrections, helpers, identifierFilters, INVALID_IDENTIFIER_FILTER, lockedExpressions, proposals, queryContext, queryPosition, SPACE_LENGTH, VALID_IDENTIFIER_FILTER, virtualSpaces, word, wordParser |
| Constructor Summary | |
|---|---|
DefaultContentAssistVisitor(JPQLQueryContext queryContext)
Creates a new DefaultContentAssistVisitor. |
|
| Method Summary | |
|---|---|
protected DefaultContentAssistVisitor.AcceptableTypeVisitor |
buildAcceptableTypeVisitor()
|
protected JPQLGrammar |
getLatestGrammar()
Returns the latest supported JPQL grammar, which is required when checking the validity of a JPQL identifier. |
protected boolean |
isJoinFetchIdentifiable()
Determines whether a JOIN FETCH expression can be identified by with an
identification variable or not. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultContentAssistVisitor(JPQLQueryContext queryContext)
DefaultContentAssistVisitor.
queryContext - The context used to query information about the query
java.lang.NullPointerException - The JPQLQueryContext cannot be null| Method Detail |
|---|
protected DefaultContentAssistVisitor.AcceptableTypeVisitor buildAcceptableTypeVisitor()
buildAcceptableTypeVisitor in class AbstractContentAssistVisitorprotected JPQLGrammar getLatestGrammar()
getLatestGrammar in class AbstractContentAssistVisitorJPQLGrammar supported by the providerprotected boolean isJoinFetchIdentifiable()
JOIN FETCH expression can be identified by with an
identification variable or not.
isJoinFetchIdentifiable in class AbstractContentAssistVisitortrue if the expression can have an identification variable;
false otherwise
|
EclipseLink 2.5.3, build 'v20180808-e38c757' API Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||