|
EclipseLink 2.5.0, build 'v20121016-ab08992' 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.DefaultContentAssistProposals
public final class DefaultContentAssistProposals
The default implementation of ContentAssistProposals which stores the valid proposals.
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.
| Constructor Summary | |
|---|---|
DefaultContentAssistProposals(JPQLGrammar jpqlGrammar,
ContentAssistProposalsHelper helper)
Creates a new DefaultContentAssistProposals. |
|
| Method Summary | |
|---|---|
java.lang.Iterable<IEntity> |
abstractSchemaTypes()
Returns the collection of possible abstract schema types. |
void |
addAbstractSchemaType(IEntity abstractSchemaType)
Adds the given IEntity as a possible abstract schema type. |
void |
addIdentificationVariable(java.lang.String identificationVariable)
Adds the given identification variable as a proposal. |
void |
addIdentifier(java.lang.String identifier)
Adds the given JPQL identifier as a proposal. |
void |
addMapping(IMapping mapping)
Adds the given mapping (state field, association field or collection field)
as a valid proposal. |
void |
addMappings(java.util.Collection<IMapping> mappings)
Adds the given mappings (state fields, association fields or collection fields)
as valid proposals. |
void |
addRangeIdentificationVariable(java.lang.String identificationVariable,
IEntity abstractSchemaType)
Adds the given range identification variable that is mapping the given abstract schema type. |
org.eclipse.persistence.jpa.jpql.DefaultContentAssistProposals.Result |
buildEscapedQuery(java.lang.String jpqlQuery,
java.lang.String proposal,
int position,
boolean insert)
Creates a new JPQL query by inserting the given proposal at the given position. |
org.eclipse.persistence.jpa.jpql.DefaultContentAssistProposals.Result |
buildQuery(java.lang.String jpqlQuery,
java.lang.String proposal,
int position,
boolean insert)
Creates a new JPQL query by inserting the given proposal at the given position. |
ResultQuery |
buildXmlQuery(java.lang.String jpqlQuery,
java.lang.String proposal,
int position,
boolean insert)
Creates a new JPQL query by inserting the given proposal at the given position. |
java.lang.Iterable<java.lang.String> |
classNames()
Returns the filtered list of possible class names. |
java.lang.Iterable<java.lang.String> |
columnNames()
Returns the filtered list of possible column names. |
IEntity |
getAbstractSchemaType(java.lang.String identificationVariable)
Retrieves the abstract schema type that is mapped with the given identification variable. |
JPQLGrammar |
getGrammar()
Returns the JPQLGrammar that defines how the JPQL query was parsed. |
IdentifierRole |
getIdentifierRole(java.lang.String identifier)
Returns the role of the given JPQL identifier. |
boolean |
hasProposals()
Determines whether there is at least one proposals. |
java.lang.Iterable<java.lang.String> |
identificationVariables()
Returns the collection of possible identification variables. |
java.lang.Iterable<java.lang.String> |
identifiers()
Returns the collection of possible JPQL identifiers. |
java.lang.Iterable<IMapping> |
mappings()
Returns the collection of possible mappings, which can be state fields,
association fields and/or collection fields depending on the location used to retrieve the
possible proposals. |
boolean |
remove(java.lang.String proposal)
This is only used by the unit-tests, it removes the given proposal from one of the collection of possible proposals. |
void |
setClassNamePrefix(java.lang.String tableNamePrefix)
Adds the given prefix that will be used to filter the list of TODO. |
void |
setTableName(java.lang.String tableName)
Sets |
void |
setTableNamePrefix(java.lang.String tableNamePrefix)
Adds |
java.lang.Iterable<java.lang.String> |
tableNames()
Returns the filtered list of possible table names. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultContentAssistProposals(JPQLGrammar jpqlGrammar,
ContentAssistProposalsHelper helper)
DefaultContentAssistProposals.
jpqlGrammar - The JPQLGrammar that defines how the JPQL query was parsedhelper - The helper can be used to provide additional information that is outside the
scope of simply providing JPA metadata information, such as table names, column names, class
names or ContentAssistProposalsHelper.NULL_HELPER if none can be provided| Method Detail |
|---|
public java.lang.Iterable<IEntity> abstractSchemaTypes()
abstractSchemaTypes in interface ContentAssistProposalsentities defined in the persistence contextpublic void addAbstractSchemaType(IEntity abstractSchemaType)
IEntity as a possible abstract schema type.
abstractSchemaType - The abstract schema type that is a valid proposalpublic void addIdentificationVariable(java.lang.String identificationVariable)
identificationVariable - The identification variable that is a valid proposalpublic void addIdentifier(java.lang.String identifier)
identifier - The JPQL identifier that is a valid proposalpublic void addMapping(IMapping mapping)
mapping (state field, association field or collection field)
as a valid proposal.
mapping - The IMapping of the state field, association field or collection fieldpublic void addMappings(java.util.Collection<IMapping> mappings)
mappings (state fields, association fields or collection fields)
as valid proposals.
mappings - The mappings of the state fields, association fields or
collection fields
public void addRangeIdentificationVariable(java.lang.String identificationVariable,
IEntity abstractSchemaType)
identificationVariable - The range identification variable mapping the abstract schema nameabstractSchemaType - The abstract type name that identifies the type of the variable
public org.eclipse.persistence.jpa.jpql.DefaultContentAssistProposals.Result buildEscapedQuery(java.lang.String jpqlQuery,
java.lang.String proposal,
int position,
boolean insert)
The replacement will also handle compound JPQL identifiers when updating the JPQL query.
Example: If the cursor is within "IS NOT N|" and the proposal is "IS NOT NULL", then "IS NOT" will not be added twice. If the word to replace is "IS NULL" and the proposal is "IS NOT NULL", then "NOT" will be inserted between "IS" and "NULL".
buildEscapedQuery in interface ContentAssistProposalsjpqlQuery - The JPQL query to modify with the given proposalproposal - The proposal to insert into the queryposition - The position of insertioninsert - Flag that determines if the partial word following the cursor should be left
intact or should be replaced by the proposal
public org.eclipse.persistence.jpa.jpql.DefaultContentAssistProposals.Result buildQuery(java.lang.String jpqlQuery,
java.lang.String proposal,
int position,
boolean insert)
The replacement will also handle compound JPQL identifiers when updating the JPQL query.
Example: If the cursor is within "IS NOT N|" and the proposal is "IS NOT NULL", then "IS NOT" will not be added twice. If the word to replace is "IS NULL" and the proposal is "IS NOT NULL", then "NOT" will be inserted between "IS" and "NULL".
buildQuery in interface ContentAssistProposalsjpqlQuery - The JPQL query to modify with the given proposalproposal - The proposal to insert into the queryposition - The position of insertioninsert - Flag that determines if the partial word following the cursor should be left
intact or should be replaced by the proposal
public ResultQuery buildXmlQuery(java.lang.String jpqlQuery,
java.lang.String proposal,
int position,
boolean insert)
The replacement will also handle compound JPQL identifiers when updating the JPQL query.
Example: If the cursor is within "IS NOT N|" and the proposal is "IS NOT NULL", then "IS NOT" will not be added twice. If the word to replace is "IS NULL" and the proposal is "IS NOT NULL", then "NOT" will be inserted between "IS" and "NULL".
buildXmlQuery in interface ContentAssistProposalsjpqlQuery - The JPQL query to modify with the given proposal, which should be the non-
converted string, i.e. any escaped characters should not be convertedproposal - The proposal to insert into the queryposition - The position of insertion, which was derived from the parsed tree representation
of the JPQL queryinsert - Flag that determines if the partial word following the cursor should be left
intact or should be replaced by the proposal
public java.lang.Iterable<java.lang.String> classNames()
classNames in interface ContentAssistProposalsConstructorExpressionpublic java.lang.Iterable<java.lang.String> columnNames()
columnNames in interface ContentAssistProposalspublic IEntity getAbstractSchemaType(java.lang.String identificationVariable)
getAbstractSchemaType in interface ContentAssistProposalsidentificationVariable - The identification variable that, if defined as a range variable,
will be mapped to a managed type
null if the given variable is mapped to something else or not mapped to anythingpublic JPQLGrammar getGrammar()
JPQLGrammar that defines how the JPQL query was parsed.
JPQLGrammar that was used to parse this jpa.jpql.parser.Expression Expressionpublic IdentifierRole getIdentifierRole(java.lang.String identifier)
getIdentifierRole in interface ContentAssistProposalsidentifier - The JPQL identifier to retrieve its role
IdentifierRole for the given JPQL identifier or null if no
role was defined or if the given string is not a valid JPQL identifierpublic boolean hasProposals()
hasProposals in interface ContentAssistProposalstrue if there is at least one proposal; otherwise falsepublic java.lang.Iterable<java.lang.String> identificationVariables()
identificationVariables in interface ContentAssistProposalspublic java.lang.Iterable<java.lang.String> identifiers()
identifiers in interface ContentAssistProposalspublic java.lang.Iterable<IMapping> mappings()
mappings, which can be state fields,
association fields and/or collection fields depending on the location used to retrieve the
possible proposals.
mappings in interface ContentAssistProposalsmappingspublic boolean remove(java.lang.String proposal)
proposal - The proposal to remove
true the given proposal was removed from one of the collections;
false if it could not be found, thus not removedpublic void setClassNamePrefix(java.lang.String tableNamePrefix)
tableNamePrefix - The prefix that is used to filter the list of TODOpublic void setTableName(java.lang.String tableName)
tableName - public void setTableNamePrefix(java.lang.String tableNamePrefix)
tableNamePrefix - public java.lang.Iterable<java.lang.String> tableNames()
tableNames in interface ContentAssistProposalspublic java.lang.String toString()
toString in class java.lang.Object
|
EclipseLink 2.5.0, build 'v20121016-ab08992' API Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||