public class NoodleOperation extends Object implements Expression
A noodle operation looks like exprA | exprB. If the first expression evaluates to null or to ""
the second expression is evaluated and its result returned. Otherwise the result of the first expression is returned.
| Modifier and Type | Field and Description |
|---|---|
protected Expression |
leftExpression |
protected Expression |
rightExpression |
| Constructor and Description |
|---|
NoodleOperation(Expression leftExpression,
Expression rightExpression)
Creates a new operation for the given operands.
|
| Modifier and Type | Method and Description |
|---|---|
Expression |
copy()
Creates a deep copy of the expression which can be modified without affecting the original expression.
|
Object |
eval(LocalRenderContext ctx)
Evaluates the expression into an object using the given context.
|
Class<?> |
getType()
Returns the Java class of the objects yielded by this expression.
|
boolean |
isConstant()
Determines if the expression is constant.
|
Expression |
propagateVisitor(ExpressionVisitor visitor)
Visits all child nodes and then the node itself.
|
Expression |
reduce()
Reduces and optimizes the expression if possible.
|
protected Expression leftExpression
protected Expression rightExpression
public NoodleOperation(Expression leftExpression, Expression rightExpression)
leftExpression - the left operandrightExpression - the right operandpublic Object eval(LocalRenderContext ctx)
Expressioneval in interface Expressionctx - the current rendering contextpublic Expression propagateVisitor(ExpressionVisitor visitor)
ExpressionpropagateVisitor in interface Expressionvisitor - the visitor to invoke for all child nodes and on the node itselfpublic Expression reduce()
Expressionreduce in interface Expressionpublic boolean isConstant()
ExpressionisConstant in interface Expressionpublic Expression copy()
Expressioncopy in interface Expressionpublic Class<?> getType()
ExpressiongetType in interface ExpressionCopyright © 2018. All rights reserved.