Top Description Inners Fields Constructors Methods
org.eclipse.persistence.jpa.jpql.parser

public final Class FunctionExpressionFactory

extends ExpressionFactory
Class Inheritance
Annotations
@SuppressWarnings:nls
Imports
org.eclipse.persistence.jpa.jpql.Assert, .ExpressionTools, .WordParser

This FunctionExpressionFactory creates a new FunctionExpression when the portion of the query to parse starts with an identifier related to a SQL function.
Author
James
Since
2.4
Version
2.5
See Also
FunctionExpression

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
public static final String
ID

The unique identifier for this FunctionExpressionFactory.

private FunctionExpressionFactory.ParameterCount
parameterCount

The number of parameters a FunctionExpression can have.

private String
parameterQueryBNFId

The unique identifier of the JPQLQueryBNF that will be used to parse the arguments of the function expression.

Constructor Summary

AccessConstructor and Description
public
FunctionExpressionFactory(String
The unique identifier of this factory
id
,
FunctionExpressionFactory.ParameterCount
The number of parameters a FunctionExpression can have
parameterCount
,
String
The unique identifier of the JPQLQueryBNF that will be used to parse the arguments of the function expression
parameterQueryBNFId
,
String...
The JPQL identifiers handled by this factory
identifiers
)

Creates a new FunctionExpressionFactory.

public
FunctionExpressionFactory(String
The unique identifier of this factory
id
,
String...
The JPQL identifiers handled by this factory
identifiers
)

Creates a new FunctionExpressionFactory.

Method Summary

Modifier and TypeMethod and Description
protected AbstractExpression
buildExpression(AbstractExpression parent, WordParser
The text to parse based on the current position of the cursor
wordParser
,
String
The current word being parsed
word
,
JPQLQueryBNF
The BNF grammar that was used to identifier this factory to be capable to parse a portion of the query
queryBNF
,
AbstractExpression
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
,
boolean tolerant)

Implements abstract org.eclipse.persistence.jpa.jpql.parser.ExpressionFactory.buildExpression.

Creates a new Expression.
public void
setParameterCount(FunctionExpressionFactory.ParameterCount
The number of parameters
parameterCount
)

Sets the number of parameters a FunctionExpression can have, which will be during validation.

public void
setParameterQueryBNFId(String
The unique identifier of the JPQLQueryBNF that will be used to parse the arguments of the function expression
parameterQueryBNFId
)

Sets the BNF that will be used when parsing the function's arguments.

Inherited from org.eclipse.persistence.jpa.jpql.parser.ExpressionFactory:
addIdentifieraddIdentifierscompareToequalsgetExpressionRegistrygetIdhashCodeidentifierssetExpressionRegistrytoString

Field Detail

IDback to summary
public static final String ID

The unique identifier for this FunctionExpressionFactory.

parameterCountback to summary
private FunctionExpressionFactory.ParameterCount parameterCount

The number of parameters a FunctionExpression can have.

parameterQueryBNFIdback to summary
private String parameterQueryBNFId

The unique identifier of the JPQLQueryBNF that will be used to parse the arguments of the function expression.

Constructor Detail

FunctionExpressionFactoryback to summary
public FunctionExpressionFactory(String id, FunctionExpressionFactory.ParameterCount parameterCount, String parameterQueryBNFId, String... identifiers)

Creates a new FunctionExpressionFactory.

Parameters
id:String

The unique identifier of this factory

parameterCount:FunctionExpressionFactory.ParameterCount

The number of parameters a FunctionExpression can have

parameterQueryBNFId:String

The unique identifier of the JPQLQueryBNF that will be used to parse the arguments of the function expression

identifiers:String[]

The JPQL identifiers handled by this factory

FunctionExpressionFactoryback to summary
public FunctionExpressionFactory(String id, String... identifiers)

Creates a new FunctionExpressionFactory.

Parameters
id:String

The unique identifier of this factory

identifiers:String[]

The JPQL identifiers handled by this factory

Method Detail

buildExpressionback to summary
protected AbstractExpression buildExpression(AbstractExpression parent, WordParser wordParser, String word, JPQLQueryBNF queryBNF, AbstractExpression expression, boolean tolerant)

Implements abstract org.eclipse.persistence.jpa.jpql.parser.ExpressionFactory.buildExpression.

Doc from org.eclipse.persistence.jpa.jpql.parser.ExpressionFactory.buildExpression.

Creates a new Expression.

Parameters
parent:AbstractExpression

The parent AbstractExpression

wordParser:WordParser

The text to parse based on the current position of the cursor

word:String

The current word being parsed

queryBNF:JPQLQueryBNF

The BNF grammar that was used to identifier this factory to be capable to parse a portion of the query

expression:AbstractExpression

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:AbstractExpression

A new AbstractExpression representing the portion or the totality of the text held by WordParser starting at the cursor position

Annotations
@Override
setParameterCountback to summary
public void setParameterCount(FunctionExpressionFactory.ParameterCount parameterCount)

Sets the number of parameters a FunctionExpression can have, which will be during validation.

Parameters
parameterCount:FunctionExpressionFactory.ParameterCount

The number of parameters

setParameterQueryBNFIdback to summary
public void setParameterQueryBNFId(String parameterQueryBNFId)

Sets the BNF that will be used when parsing the function's arguments.

Parameters
parameterQueryBNFId:String

The unique identifier of the JPQLQueryBNF that will be used to parse the arguments of the function expression

org.eclipse.persistence.jpa.jpql.parser back to summary

public final Enum FunctionExpressionFactory.ParameterCount

extends Enum<FunctionExpressionFactory.ParameterCount>
Class Inheritance

The number of parameters a FunctionExpression can have.

Field Summary

Modifier and TypeField and Description
public static final FunctionExpressionFactory.ParameterCount
ONE

Only one parameter is allowed.

public static final FunctionExpressionFactory.ParameterCount
ONE_OR_MANY

[1, n] are allowed.

public static final FunctionExpressionFactory.ParameterCount
ZERO

No parameters are allowed.

public static final FunctionExpressionFactory.ParameterCount
ZERO_OR_MANY

[0, n] are allowed.

public static final FunctionExpressionFactory.ParameterCount
ZERO_OR_ONE

[0, 1] are allowed.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static FunctionExpressionFactory.ParameterCount
public static FunctionExpressionFactory.ParameterCount[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ONEback to summary
public static final FunctionExpressionFactory.ParameterCount ONE

Only one parameter is allowed.

ONE_OR_MANYback to summary
public static final FunctionExpressionFactory.ParameterCount ONE_OR_MANY

[1, n] are allowed.

ZEROback to summary
public static final FunctionExpressionFactory.ParameterCount ZERO

No parameters are allowed.

ZERO_OR_MANYback to summary
public static final FunctionExpressionFactory.ParameterCount ZERO_OR_MANY

[0, n] are allowed.

ZERO_OR_ONEback to summary
public static final FunctionExpressionFactory.ParameterCount ZERO_OR_ONE

[0, 1] are allowed.

Constructor Detail

ParameterCountback to summary
private ParameterCount()

Method Detail

valueOfback to summary
public static FunctionExpressionFactory.ParameterCount valueOf(String name)
valuesback to summary
public static FunctionExpressionFactory.ParameterCount[] values()