|
EclipseLink 2.4.2, build 'v20130514-5956486' 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.parser.ExpressionFactory
org.eclipse.persistence.jpa.jpql.parser.FunctionExpressionFactory
public final class FunctionExpressionFactory
This FunctionExpressionFactory
creates a new FunctionExpression
when the portion
of the query to parse starts with an identifier related to a SQL function.
FunctionExpression
Nested Class Summary | |
---|---|
static class |
FunctionExpressionFactory.ParameterCount
The number of parameters a FunctionExpression can have. |
Field Summary | |
---|---|
static java.lang.String |
ID
The unique identifier for this FunctionExpressionFactory . |
Constructor Summary | |
---|---|
FunctionExpressionFactory(java.lang.String id,
FunctionExpressionFactory.ParameterCount parameterCount,
java.lang.String parameterQueryBNFId,
java.lang.String... identifiers)
Creates a new FunctionExpressionFactory . |
|
FunctionExpressionFactory(java.lang.String id,
java.lang.String... identifiers)
Creates a new FunctionExpressionFactory . |
Method Summary | |
---|---|
protected AbstractExpression |
buildExpression(AbstractExpression parent,
WordParser wordParser,
java.lang.String word,
JPQLQueryBNF queryBNF,
AbstractExpression expression,
boolean tolerant)
Creates a new Expression . |
protected boolean |
isFunctionExpression(WordParser wordParser,
java.lang.String identifier)
Determines whether the JPQL fragment is an expression of the form <IDENTIFIER>( . |
void |
setParameterCount(FunctionExpressionFactory.ParameterCount parameterCount)
Sets the number of parameters a FunctionExpression can have, which will be during
validation. |
void |
setParameterQueryBNFId(java.lang.String parameterQueryBNFId)
Sets the BNF that will be used when parsing the function's arguments. |
Methods inherited from class org.eclipse.persistence.jpa.jpql.parser.ExpressionFactory |
---|
compareTo, equals, getExpressionRegistry, getFallBackExpressionFactoryId, getId, hashCode, identifiers, setFallBackExpressionFactory, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ID
FunctionExpressionFactory
.
Constructor Detail |
---|
public FunctionExpressionFactory(java.lang.String id, FunctionExpressionFactory.ParameterCount parameterCount, java.lang.String parameterQueryBNFId, java.lang.String... identifiers)
FunctionExpressionFactory
.
id
- The unique identifier of this factoryparameterCount
- The number of parameters
a FunctionExpression
can haveparameterQueryBNFId
- The unique identifier of the JPQLQueryBNF
that will be used
to parse the arguments of the function expressionidentifiers
- The JPQL identifiers handled by this factorypublic FunctionExpressionFactory(java.lang.String id, java.lang.String... identifiers)
FunctionExpressionFactory
.
id
- The unique identifier of this factoryidentifiers
- The JPQL identifiers handled by this factoryMethod Detail |
---|
protected AbstractExpression buildExpression(AbstractExpression parent, WordParser wordParser, java.lang.String word, JPQLQueryBNF queryBNF, AbstractExpression expression, boolean tolerant)
Expression
.
buildExpression
in class ExpressionFactory
parent
- The parent expressionwordParser
- The text to parse based on the current position of the cursorword
- The current word to parsequeryBNF
- 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
Expression
representing a portion or the totality of the given textprotected boolean isFunctionExpression(WordParser wordParser, java.lang.String identifier)
<IDENTIFIER>(
.
wordParser
- The text to parse based on the current position of the cursoridentifier
- The identifier to verify if it's for an expression or for possibly for a
variable name
true
if the identifier is followed by '('; false
otherwisepublic void setParameterCount(FunctionExpressionFactory.ParameterCount parameterCount)
FunctionExpression
can have, which will be during
validation.
parameterCount
- The number of parameterspublic void setParameterQueryBNFId(java.lang.String parameterQueryBNFId)
parameterQueryBNFId
- The unique identifier of the JPQLQueryBNF
that will be used
to parse the arguments of the function expression
|
EclipseLink 2.4.2, build 'v20130514-5956486' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |