public abstract class ExpressionFactory extends java.lang.Object implements java.lang.Comparable<ExpressionFactory>
ExpressionFactory
is responsible to parse a portion of JPQL query which starts
with one of the factory's JPQL identifiers.
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 | Constructor and Description |
---|---|
protected |
ExpressionFactory(java.lang.String id,
java.lang.String... identifiers)
Creates a new
ExpressionFactory . |
Modifier and Type | Method and Description |
---|---|
protected abstract AbstractExpression |
buildExpression(AbstractExpression parent,
WordParser wordParser,
java.lang.String word,
JPQLQueryBNF queryBNF,
AbstractExpression expression,
boolean tolerant)
Creates a new
Expression . |
int |
compareTo(ExpressionFactory expressionFactory) |
boolean |
equals(java.lang.Object object) |
ExpressionRegistry |
getExpressionRegistry()
Returns the registry containing the
JPQLQueryBNFs and the ExpressionFactories that are used
to properly parse a JPQL query. |
java.lang.String |
getId()
Returns the unique identifier of this
ExpressionFactory . |
int |
hashCode() |
java.lang.String[] |
identifiers()
Returns the JPQL identifiers handled by this factory.
|
java.lang.String |
toString() |
protected ExpressionFactory(java.lang.String id, java.lang.String... identifiers)
ExpressionFactory
.id
- The unique identifier of this ExpressionFactory
identifiers
- The JPQL identifiers handled by this factoryjava.lang.NullPointerException
- The given unique identifier cannot be null
or
the list of JPQL identifiers was null
protected abstract AbstractExpression buildExpression(AbstractExpression parent, WordParser wordParser, java.lang.String word, JPQLQueryBNF queryBNF, AbstractExpression expression, boolean tolerant)
Expression
.parent
- The parent AbstractExpression
wordParser
- The text to parse based on the current position of the cursorword
- The current word being parsedqueryBNF
- The BNF grammar that was used to identifier this factory to be capable to
parse a portion of the queryexpression
- During the parsing, it is possible the first part of an expression was
parsed which needs to be used as a sub-expression of the newly created expressionAbstractExpression
representing the portion or the totality of the
text held by WordParser
starting at the cursor positionpublic final int compareTo(ExpressionFactory expressionFactory)
compareTo
in interface java.lang.Comparable<ExpressionFactory>
public final boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public final ExpressionRegistry getExpressionRegistry()
JPQLQueryBNFs
and the ExpressionFactories
that are used
to properly parse a JPQL query.public final java.lang.String getId()
ExpressionFactory
.ExpressionFactory
with ExpressionRegistry
public final int hashCode()
hashCode
in class java.lang.Object
public final java.lang.String[] identifiers()
public final java.lang.String toString()
toString
in class java.lang.Object