public final class DefaultContentAssistProposals extends java.lang.Object implements ContentAssistProposals
ContentAssistProposals
which stores the valid proposals.Constructor and Description |
---|
DefaultContentAssistProposals()
Creates a new
DefaultContentAssistProposals . |
Modifier and Type | Method and Description |
---|---|
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.internal.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.internal.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.
|
IEntity |
getAbstractSchemaType(java.lang.String identificationVariable)
Retrieves the abstract schema type that is mapped with the given identification variable.
|
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.
|
java.lang.String |
toString() |
public DefaultContentAssistProposals()
DefaultContentAssistProposals
.public java.lang.Iterable<IEntity> abstractSchemaTypes()
abstractSchemaTypes
in interface ContentAssistProposals
entities
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 fieldspublic 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 variablepublic org.eclipse.persistence.jpa.internal.jpql.DefaultContentAssistProposals.Result buildEscapedQuery(java.lang.String jpqlQuery, java.lang.String proposal, int position, boolean insert)
TODO: TO REWORD: If the proposal is has more than one identifier, for instance, IS NOT
NULL
, then the replacement will go further than just replacing the current word. If the
cursor is in "IS NOT N|" and the proposal is "IS NOT NULL", then "IS NOT" will not be added
twice. If the identifier is "IS NULL" and the proposal is "IS NOT NULL", then NOT will be
inserted between IS and NULL.
buildEscapedQuery
in interface ContentAssistProposals
jpqlQuery
- The JPQL query to insert 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 replaced by the proposalpublic org.eclipse.persistence.jpa.internal.jpql.DefaultContentAssistProposals.Result buildQuery(java.lang.String jpqlQuery, java.lang.String proposal, int position, boolean insert)
TODO: TO REWORD: If the proposal is has more than one identifier, for instance, IS NOT
NULL
, then the replacement will go further than just replacing the current word. If the
cursor is in "IS NOT N|" and the proposal is "IS NOT NULL", then "IS NOT" will not be added
twice. If the identifier is "IS NULL" and the proposal is "IS NOT NULL", then NOT will be
inserted between IS and NULL.
buildQuery
in interface ContentAssistProposals
jpqlQuery
- The JPQL query to insert 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 replaced by the proposalpublic IEntity getAbstractSchemaType(java.lang.String identificationVariable)
getAbstractSchemaType
in interface ContentAssistProposals
identificationVariable
- The identification variable that, if defined as a range variable,
will be mapped to a managed typenull
if the given variable is mapped to something else or not mapped to anythingpublic boolean hasProposals()
hasProposals
in interface ContentAssistProposals
true
if there is at least one proposal; otherwise false
public java.lang.Iterable<java.lang.String> identificationVariables()
identificationVariables
in interface ContentAssistProposals
public java.lang.Iterable<java.lang.String> identifiers()
identifiers
in interface ContentAssistProposals
public 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 ContentAssistProposals
mappings
public boolean remove(java.lang.String proposal)
proposal
- The proposal to removetrue
the given proposal was removed from one of the collections;
false
if it could not be found, thus not removedpublic java.lang.String toString()
toString
in class java.lang.Object
EclipseLink 2.3.2, "build v20111125-r10461" API Reference