java.lang.Object
org.tentackle.wurblet.WurbletArgumentExpression
- All Implemented Interfaces:
WurbletArgumentOperand
An expression of wurblet arguments or other expressions.
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new expression. -
Method Summary
Modifier and TypeMethodDescriptionaddOperand(WurbletArgumentOperator operator, WurbletArgumentOperand operand) Adds an operand.Gets the paths for wurblet arguments which can be expressed in a single SQL EXISTS clause.
The returned list is empty, if there are no paths at all or each argument needs its own EXISTS clause.Gets the n operands.Gets the n-1 operators.Gets the parent expression.booleanReturns whether expression must be enclosed in parentheses after an AND operator.toCode(CodeGenerator<Object> generator) Generates the code.toString()
-
Constructor Details
-
WurbletArgumentExpression
Creates a new expression.- Parameters:
parent- optional parent expression, null if this is the top level expression
-
-
Method Details
-
getParent
Gets the parent expression.- Returns:
- the parent, null if top level
-
getOperands
Gets the n operands.- Returns:
- the operands
-
getOperators
Gets the n-1 operators.- Returns:
- the operators
-
getMergedPaths
Gets the paths for wurblet arguments which can be expressed in a single SQL EXISTS clause.
The returned list is empty, if there are no paths at all or each argument needs its own EXISTS clause.- Returns:
- the paths, empty if none, never null
-
addOperand
public WurbletArgumentOperator addOperand(WurbletArgumentOperator operator, WurbletArgumentOperand operand) throws org.wurbelizer.wurbel.WurbelException Adds an operand.- Parameters:
operator- the operator, null defaults to ADDoperand- the operand- Returns:
- the operator, null if start of expression
- Throws:
org.wurbelizer.wurbel.WurbelException- if failed
-
needParenthesesAfterAndOperator
public boolean needParenthesesAfterAndOperator()Returns whether expression must be enclosed in parentheses after an AND operator.- Returns:
- true need parentheses
-
toCode
Generates the code.- Parameters:
generator- the code generator- Returns:
- the generated code
- Throws:
org.wurbelizer.wurbel.WurbelException- if code generation failed
-
toString
-