public class CompareToNullExpression
extends BinaryExpression
Specializes a comparison against null for static compilation.
| Fields inherited from class | Fields |
|---|---|
class Expression |
EMPTY_ARRAY |
| Constructor and description |
|---|
CompareToNullExpression(Expression expression, boolean equalsNull)Creates a comparison between an expression and null. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Expression |
getObjectExpression()Returns the expression being compared with null. |
|
public void |
setLeftExpression(Expression expression)Prevents replacing the compared expression after construction. |
|
public void |
setRightExpression(Expression expression)Prevents changing the fixed null right-hand operand. |
|
public void |
setType(ClassNode type)Prevents changing the fixed boolean result type of this expression. |
|
public Expression |
transformExpression(ExpressionTransformer transformer)Transforms the compared expression while preserving the null-comparison semantics. |
|
public void |
visit(GroovyCodeVisitor visitor)Emits direct null-comparison bytecode for this expression. |
Creates a comparison between an expression and null.
expression - the expression being comparedequalsNull - true for == null; false for != null Returns the expression being compared with null.
Prevents replacing the compared expression after construction.
expression - ignored Prevents changing the fixed null right-hand operand.
expression - ignoredPrevents changing the fixed boolean result type of this expression.
type - ignored Transforms the compared expression while preserving the null-comparison semantics.
transformer - the expression transformer to applynull-comparison expression Emits direct null-comparison bytecode for this expression.
visitor - the visitor to acceptCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.