public class AttributeExpression
extends PropertyExpression
Represents an attribute access (accessing the field of a class) such as the expression "foo.@bar".
| Fields inherited from class | Fields |
|---|---|
class Expression |
EMPTY_ARRAY |
| Constructor and description |
|---|
AttributeExpression(Expression objectExpression, Expression property)Creates an attribute access that is not null-safe. |
AttributeExpression(Expression objectExpression, Expression property, boolean safe)Creates an attribute access and records whether it is null-safe. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public String |
getText() |
|
public Expression |
transformExpression(ExpressionTransformer transformer) |
|
public void |
visit(GroovyCodeVisitor visitor) |
Creates an attribute access that is not null-safe. Equivalent to AttributeExpression(objectExpression, property, false).
objectExpression - the receiver, as in foo of foo.@barproperty - the attribute, as in bar of foo.@bar Creates an attribute access and records whether it is null-safe.
When safe is true the access is the ?. form, which yields
null when the receiver is null.
objectExpression - the receiver, as in foo of foo.@barproperty - the attribute, as in bar of foo.@barsafe - true for a null-safe ?. accessCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.