Class ExpressionFactory
java.lang.Object
org.eclipse.persistence.jpa.jpql.parser.ExpressionFactory
- All Implemented Interfaces:
Comparable<ExpressionFactory>
- Direct Known Subclasses:
AbsExpressionFactory
,AbstractLiteralExpressionFactory
,AbstractSchemaNameFactory
,AllOrAnyExpressionFactory
,AndExpressionFactory
,ArithmeticExpressionFactory
,AsOfClauseFactory
,AvgFunctionFactory
,BadExpressionFactory
,BetweenExpressionFactory
,CaseExpressionFactory
,CastExpressionFactory
,CoalesceExpressionFactory
,CollectionMemberDeclarationFactory
,CollectionMemberExpressionFactory
,ComparisonExpressionFactory
,ConcatExpressionFactory
,ConnectByClauseFactory
,ConstructorExpressionFactory
,CountFunctionFactory
,DatabaseTypeFactory
,DateTimeFactory
,DeleteClauseFactory
,DeleteStatementFactory
,EntryExpressionFactory
,ExistsExpressionFactory
,ExtractExpressionFactory
,FromClauseFactory
,FunctionExpressionFactory
,GeneralIdentificationExpressionFactory
,GroupByClauseFactory
,GroupByItemFactory
,HavingClauseFactory
,HierarchicalQueryClauseFactory
,IdentificationVariableDeclarationFactory
,IdentificationVariableFactory
,IndexExpressionFactory
,InExpressionFactory
,InternalOrderByItemFactory
,IsExpressionFactory
,JoinFactory
,KeywordExpressionFactory
,LengthExpressionFactory
,LikeExpressionFactory
,LocalDateTypeFactory
,LocalExpressionFactory
,LocateExpressionFactory
,LowerExpressionFactory
,MathExpressionFactory
,MaxFunctionFactory
,MinFunctionFactory
,ModExpressionFactory
,NotExpressionFactory
,NullIfExpressionFactory
,ObjectExpressionFactory
,OnClauseFactory
,OrderByClauseFactory
,OrderByItemFactory
,OrderSiblingsByClauseFactory
,OrExpressionFactory
,RangeDeclarationFactory
,RangeVariableDeclarationFactory
,RegexpExpressionFactory
,ResultVariableFactory
,SelectClauseFactory
,SelectStatementFactory
,SimpleSelectStatementFactory
,SizeExpressionFactory
,SqrtExpressionFactory
,StartWithClauseFactory
,StringLiteralFactory
,SubstringExpressionFactory
,SumFunctionFactory
,TableExpressionFactory
,TableVariableDeclarationFactory
,TreatExpressionFactory
,TrimExpressionFactory
,TypeExpressionFactory
,UnionClauseFactory
,UnknownExpressionFactory
,UpdateClauseFactory
,UpdateItemFactory
,UpdateItemStateFieldPathExpressionFactory
,UpdateStatementFactory
,UpperExpressionFactory
,WhenClauseFactory
,WhereClauseFactory
An
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.
- Since:
- 2.3
- Version:
- 2.5
-
Constructor Summary
ModifierConstructorDescriptionprotected
ExpressionFactory
(String id, String... identifiers) Creates a newExpressionFactory
. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AbstractExpression
buildExpression
(AbstractExpression parent, WordParser wordParser, String word, JPQLQueryBNF queryBNF, AbstractExpression expression, boolean tolerant) Creates a newExpression
.final int
compareTo
(ExpressionFactory expressionFactory) final boolean
final ExpressionRegistry
Returns the registry containing theJPQLQueryBNFs
and theExpressionFactories
that are used to properly parse a JPQL query.final String
getId()
Returns the unique identifier of thisExpressionFactory
.final int
hashCode()
final String[]
Returns the JPQL identifiers handled by this factory.final String
toString()
-
Constructor Details
-
ExpressionFactory
Creates a newExpressionFactory
.- Parameters:
id
- The unique identifier of thisExpressionFactory
identifiers
- The JPQL identifiers handled by this factory- Throws:
NullPointerException
- The given unique identifier cannot benull
or the list of JPQL identifiers wasnull
-
-
Method Details
-
buildExpression
protected abstract AbstractExpression buildExpression(AbstractExpression parent, WordParser wordParser, String word, JPQLQueryBNF queryBNF, AbstractExpression expression, boolean tolerant) Creates a newExpression
.- Parameters:
parent
- The parentAbstractExpression
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 expression- Returns:
- A new
AbstractExpression
representing the portion or the totality of the text held byWordParser
starting at the cursor position
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ExpressionFactory>
-
equals
-
getExpressionRegistry
Returns the registry containing theJPQLQueryBNFs
and theExpressionFactories
that are used to properly parse a JPQL query.- Returns:
- The registry containing the information related to the JPQL grammar
-
getId
Returns the unique identifier of thisExpressionFactory
.- Returns:
- The identifier used to register this
ExpressionFactory
withExpressionRegistry
-
hashCode
public final int hashCode() -
identifiers
Returns the JPQL identifiers handled by this factory.- Returns:
- The list of JPQL identifiers this factory knows how to parse
-
toString
-