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

public final Class ArithmeticExpressionFactory

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

This ExpressionFactory creates a new expression when the portion of the query to parse starts with an arithmetic identifier. It is possible the expression to parse is also a NumericLiteral or an ArithmeticFactor.
Author
Pascal Filion
Since
2.3
Version
2.4

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
public static final String
ID

The unique identifier of this ArithmeticExpressionFactory.

private ArithmeticExpressionFactory.ArithmeticExpressionVisitor
visitor

This ExpressionVisitor is used to check if the Expression passed to this factory is an AdditionExpression or SubtractionExpression.

Constructor Summary

AccessConstructor and Description
public
ArithmeticExpressionFactory()

Creates a new AbstractArithmeticExpressionFactory.

Method Summary

Modifier and TypeMethod and Description
private CompoundExpression

Returns:

A new CompoundExpression
buildExpression
(AbstractExpression
The parent of the new Expression
parent
,
char
The arithmetic character
character
)

Creates the Expression this factory for which it is responsible.

protected final 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.
private ArithmeticExpressionFactory.ArithmeticExpressionVisitor
Inherited from org.eclipse.persistence.jpa.jpql.parser.ExpressionFactory:
addIdentifieraddIdentifierscompareToequalsgetExpressionRegistrygetIdhashCodeidentifierssetExpressionRegistrytoString

Field Detail

IDback to summary
public static final String ID

The unique identifier of this ArithmeticExpressionFactory.

visitorback to summary
private ArithmeticExpressionFactory.ArithmeticExpressionVisitor visitor

This ExpressionVisitor is used to check if the Expression passed to this factory is an AdditionExpression or SubtractionExpression.

Constructor Detail

ArithmeticExpressionFactoryback to summary
public ArithmeticExpressionFactory()

Creates a new AbstractArithmeticExpressionFactory.

Method Detail

buildExpressionback to summary
private CompoundExpression buildExpression(AbstractExpression parent, char character)

Creates the Expression this factory for which it is responsible.

Parameters
parent:AbstractExpression

The parent of the new Expression

character:char

The arithmetic character

Returns:CompoundExpression

A new CompoundExpression

buildExpressionback to summary
protected final 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
visitorback to summary
private ArithmeticExpressionFactory.ArithmeticExpressionVisitor visitor()
org.eclipse.persistence.jpa.jpql.parser back to summary

private final Class ArithmeticExpressionFactory.ArithmeticExpressionVisitor

extends AbstractExpressionVisitor
Class Inheritance

This ExpressionVisitor is used to check if the Expression passed to this factory is an AdditionExpression or SubtractionExpression.

Field Summary

Modifier and TypeField and Description
pack-priv boolean
found

This flag is turned on if the Expression visited is OrExpression.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
public void
Inherited from org.eclipse.persistence.jpa.jpql.parser.AbstractExpressionVisitor:
visitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisit

Field Detail

foundback to summary
pack-priv boolean found

This flag is turned on if the Expression visited is OrExpression.

Constructor Detail

ArithmeticExpressionVisitorback to summary
private ArithmeticExpressionVisitor()

Method Detail

visitback to summary
public void visit(AdditionExpression expression)

Overrides org.eclipse.persistence.jpa.jpql.parser.AbstractExpressionVisitor.visit.

Implements org.eclipse.persistence.jpa.jpql.parser.ExpressionVisitor.visit.

Doc from org.eclipse.persistence.jpa.jpql.parser.ExpressionVisitor.visit.

Visits the AdditionExpression expression.

Parameters
expression:AdditionExpression

The Expression to visit

Annotations
@Override
visitback to summary
public void visit(SubtractionExpression expression)

Overrides org.eclipse.persistence.jpa.jpql.parser.AbstractExpressionVisitor.visit.

Implements org.eclipse.persistence.jpa.jpql.parser.ExpressionVisitor.visit.

Doc from org.eclipse.persistence.jpa.jpql.parser.ExpressionVisitor.visit.

Visits the SubtractionExpression expression.

Parameters
expression:SubtractionExpression

The Expression to visit

Annotations
@Override