public abstract class AbstractJPQLQueryBuilder extends java.lang.Object implements IJPQLQueryBuilder
IJPQLQueryBuilder
that parses a JPQL query or any JPQL
fragments and creates the StateObject
representation by delegating the creation to an
instance of BasicStateObjectBuilder
.DefaultJPQLQueryBuilder
,
EclipseLinkJPQLQueryBuilder
Modifier | Constructor and Description |
---|---|
protected |
AbstractJPQLQueryBuilder()
Creates a new
AbstractJPQLQueryBuilder . |
Modifier and Type | Method and Description |
---|---|
ICaseExpressionStateObjectBuilder |
buildCaseExpressionStateObjectBuilder(StateObject parent)
Creates a builder that can create a
CASE expression programmatically. |
JPQLQueryStateObject |
buildStateObject(IManagedTypeProvider provider,
java.lang.CharSequence jpqlQuery,
boolean tolerant)
Creates a state model representation of a JPQL query that can be edited.
|
JPQLQueryStateObject |
buildStateObject(IManagedTypeProvider provider,
java.lang.CharSequence jpqlQuery,
java.lang.String queryBNFId,
boolean tolerant)
Creates a state model representation of a JPQL query that can be edited.
|
StateObject |
buildStateObject(StateObject parent,
java.lang.CharSequence jpqlFragment,
java.lang.String queryBNFId)
Creates a
StateObject representation of the given JPQL fragment. |
protected abstract BasicStateObjectBuilder |
buildStateObjectBuilder()
Creates the builder that creates the
StateObject for each {@link org.eclipse. |
protected BasicStateObjectBuilder |
getStateObjectBuilder()
Returns the builder that creates the
StateObject for each {@link org.eclipse. |
protected JPQLExpression |
parse(java.lang.CharSequence jpqlQuery,
JPQLGrammar jpqlGrammar,
boolean tolerant)
Parses the given JPQL query with tolerant mode turned on.
|
protected JPQLExpression |
parse(java.lang.CharSequence jpqFragment,
JPQLGrammar jpqlGrammar,
java.lang.String queryBNFId)
Parses the given JPQL fragment with tolerant mode turned on.
|
protected ExpressionVisitor |
wrap(BasicStateObjectBuilder builder)
If a subclass needs to wrap the given
BasicStateObjectBuilder with another visitor can
do so by simply overriding this method. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildStateObjectBuilder, buildStateObjectBuilder, buildStateObjectBuilder, buildStateObjectBuilder, getGrammar
protected AbstractJPQLQueryBuilder()
AbstractJPQLQueryBuilder
.public ICaseExpressionStateObjectBuilder buildCaseExpressionStateObjectBuilder(StateObject parent)
CASE
expression programmatically. Once
the expression is complete, ICaseExpressionStateObjectBuilder.buildStateObject()
will
return the result.buildCaseExpressionStateObjectBuilder
in interface IJPQLQueryBuilder
parent
- The StateObject
that will be the parent of the newly created modelCASE
expressionpublic JPQLQueryStateObject buildStateObject(IManagedTypeProvider provider, java.lang.CharSequence jpqlQuery, boolean tolerant)
buildStateObject
in interface IJPQLQueryBuilder
provider
- The provider of managed typesjpqlQuery
- The JPQL query to parse into a StateObject
modeltolerant
- Determines if the parsing system should be tolerant, meaning if it should try
to parse invalid or incomplete queriesStateObject
model that represents the edited form of the JPQL querypublic JPQLQueryStateObject buildStateObject(IManagedTypeProvider provider, java.lang.CharSequence jpqlQuery, java.lang.String queryBNFId, boolean tolerant)
buildStateObject
in interface IJPQLQueryBuilder
provider
- The provider of managed typesjpqlQuery
- The JPQL query to parse into a StateObject
modelqueryBNFId
- The unique identifier of the query BNF that will be used to parse the fragmenttolerant
- Determines if the parsing system should be tolerant, meaning if it should try
to parse invalid or incomplete queriesStateObject
model that represents the edited form of the JPQL querypublic StateObject buildStateObject(StateObject parent, java.lang.CharSequence jpqlFragment, java.lang.String queryBNFId)
StateObject
representation of the given JPQL fragment. In order to properly
parse the fragment, the given unique identifier of the parser.JPQLQueryBNF JPQLQueryBNF
will determine how to parse it.
It is possible the given JPQL fragment has more than one expression, in this case, parsing should stop at the first comma (x, y) or space (x y) where x and y are two separate expressions.
buildStateObject
in interface IJPQLQueryBuilder
parent
- The StateObject
that will be the parent of the newly created modeljpqlFragment
- A portion of a JPQL query that will be parsed and the StateObject
representation will be createdqueryBNFId
- The unique identifier of the query BNF that will be used to parse the fragmentStateObject
representation of the given JPQL fragmentprotected abstract BasicStateObjectBuilder buildStateObjectBuilder()
StateObject
for each persistence.jpa.jpql.parser.Expression Expression
.Expression Expression
protected final BasicStateObjectBuilder getStateObjectBuilder()
StateObject
for each persistence.jpa.jpql.parser.Expression Expression
.Expression Expression
protected JPQLExpression parse(java.lang.CharSequence jpqlQuery, JPQLGrammar jpqlGrammar, boolean tolerant)
query
- The string representation of the JPQL query to parsejpqlGrammar
- The JPQL grammar that defines how to parse a JPQL querytolerant
- Determines if the parsing system should be tolerant, meaning if it should try
to parse invalid or incomplete queriesprotected JPQLExpression parse(java.lang.CharSequence jpqFragment, JPQLGrammar jpqlGrammar, java.lang.String queryBNFId)
jpqFragment
- The string representation of the portion of a JPQL query to parsejpqlGrammar
- The JPQL grammar that defines how to parse a JPQL queryqueryBNFId
- The unique identifier of the queryBNFId
protected ExpressionVisitor wrap(BasicStateObjectBuilder builder)
BasicStateObjectBuilder
with another visitor can
do so by simply overriding this method. buildStateObjectBuilder()
can't be easily
overridden with an ExpressionVisitor
due to the constraint on the return type.builder
- The builder to wrap