Class ExpressionCompiler
- java.lang.Object
-
- org.datanucleus.store.query.expression.ExpressionCompiler
-
public class ExpressionCompiler extends java.lang.Object
Compiler for expressions. Responsible for taking a Node tree and creating an Expression tree.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Map<java.lang.String,java.lang.String>
aliasByPrefix
(package private) SymbolTable
symtbl
-
Constructor Summary
Constructors Constructor Description ExpressionCompiler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Expression
compileAdditiveMultiplicativeExpression(Node node)
Expression
compileExpression(Node node)
Primary entry point for compiling a node for the filter, grouping, having, result clauses.Expression
compileFromExpression(Node node, boolean classIsExpression)
Primary entry point for compiling a node for the from clause.private Expression
compileOrAndExpression(Node node)
This method deals with the OR/AND conditions.Expression
compileOrderExpression(Node node)
Primary entry point for compiling a node for the order clause.private Expression
compilePrimaryExpression(Node node)
private Expression
compileRelationalExpression(Node node)
private Expression
compileUnaryExpression(Node node)
private java.util.List<Expression>
getExpressionsForPropertiesOfNode(Node node)
Convenience method to extract properties for this node and return the associated list of expressions.private boolean
isOperator(Node node, java.lang.String operator)
void
setMethodAliases(java.util.Map<java.lang.String,java.lang.String> aliasByPrefix)
void
setSymbolTable(SymbolTable symtbl)
-
-
-
Field Detail
-
symtbl
SymbolTable symtbl
-
aliasByPrefix
java.util.Map<java.lang.String,java.lang.String> aliasByPrefix
-
-
Method Detail
-
setMethodAliases
public void setMethodAliases(java.util.Map<java.lang.String,java.lang.String> aliasByPrefix)
-
setSymbolTable
public void setSymbolTable(SymbolTable symtbl)
-
compileOrderExpression
public Expression compileOrderExpression(Node node)
Primary entry point for compiling a node for the order clause.- Parameters:
node
- The node- Returns:
- Its compiled expression
-
compileFromExpression
public Expression compileFromExpression(Node node, boolean classIsExpression)
Primary entry point for compiling a node for the from clause.- Parameters:
node
- The nodeclassIsExpression
- whether the class of the from node is an expression relating to the outer query- Returns:
- Its compiled expression
-
compileExpression
public Expression compileExpression(Node node)
Primary entry point for compiling a node for the filter, grouping, having, result clauses.- Parameters:
node
- The node- Returns:
- Its compiled expression
-
compileOrAndExpression
private Expression compileOrAndExpression(Node node)
This method deals with the OR/AND conditions. A condition specifies a combination of one or more expressions and logical (Boolean) operators and returns a value of TRUE, FALSE, or unknown- Parameters:
node
- The Node to process
-
compileRelationalExpression
private Expression compileRelationalExpression(Node node)
-
compileAdditiveMultiplicativeExpression
private Expression compileAdditiveMultiplicativeExpression(Node node)
-
compileUnaryExpression
private Expression compileUnaryExpression(Node node)
-
compilePrimaryExpression
private Expression compilePrimaryExpression(Node node)
-
getExpressionsForPropertiesOfNode
private java.util.List<Expression> getExpressionsForPropertiesOfNode(Node node)
Convenience method to extract properties for this node and return the associated list of expressions.- Parameters:
node
- The node- Returns:
- The list of expressions for the properties (or null if no properties)
-
isOperator
private boolean isOperator(Node node, java.lang.String operator)
-
-