public class PropertyExpression
extends Expression
Represents a property access such as the expression "foo.bar".
| Fields inherited from class | Fields |
|---|---|
class Expression |
EMPTY_ARRAY |
| Constructor and description |
|---|
PropertyExpression(Expression objectExpression, String propertyName)Builds a property access that is not safe, with a constant property name. |
PropertyExpression(Expression objectExpression, Expression property)Builds a property access that is not safe. |
PropertyExpression(Expression objectExpression, Expression property, boolean safe)Builds a property access, optionally with safe navigation. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Expression |
getObjectExpression()Returns the receiver of this property access. |
|
public Expression |
getProperty()Returns the expression that names the property. |
|
public String |
getPropertyAsString()Returns the property name when it is a constant. |
|
public String |
getText() |
|
public boolean |
isDynamic()Reports this property access as dynamic. |
|
public boolean |
isImplicitThis()Indicates whether the receiver stands for an implicit this rather than an
expression written at this property. |
|
public boolean |
isSafe()
|
|
public boolean |
isSpreadSafe()Indicates whether this access uses spread-dot navigation ( *.).
|
|
public boolean |
isStatic()Returns the static-access flag. |
|
public void |
setImplicitThis(boolean implicitThis)Records whether the receiver stands for an implicit this. |
|
public void |
setObjectExpression(Expression objectExpression)Replaces the receiver of this property access. |
|
public void |
setSpreadSafe(boolean spreadSafe)Records whether this access uses spread-dot navigation ( *.). |
|
public void |
setStatic(boolean isStatic)Records whether this access targets a static member. |
|
public String |
toString() |
|
public Expression |
transformExpression(ExpressionTransformer transformer) |
|
public void |
visit(GroovyCodeVisitor visitor) |
| Methods inherited from class | Name |
|---|---|
class Expression |
getType, setType, transformExpression, transformExpressions, transformExpressions |
class AnnotatedNode |
addAnnotation, addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic |
class ASTNode |
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit |
Builds a property access that is not safe, with a constant property name.
objectExpression - receiver of the accesspropertyName - name stored as a ConstantExpressionBuilds a property access that is not safe.
objectExpression - receiver of the accessproperty - expression that yields the property nameBuilds a property access, optionally with safe navigation.
objectExpression - receiver of the accessproperty - expression that yields the property namesafe - true for ?. navigation, which yields null
when the receiver is nullReturns the receiver of this property access.
Returns the expression that names the property.
Returns the property name when it is a constant. A non-constant property has no fixed name at this node.
null
when the property is not a ConstantExpression Reports this property access as dynamic. This implementation always returns true.
true Indicates whether the receiver stands for an implicit this rather than an
expression written at this property. The flag starts false.
true when the receiver was inserted for an implicit this
Indicates whether this access uses spread-dot navigation (*.).
The flag starts false.
true when the access is spread-safe Returns the static-access flag. It starts false and is copied by
transformExpression(ExpressionTransformer).
true when the access is marked static Records whether the receiver stands for an implicit this.
implicitThis - true when the receiver was not written at this propertyReplaces the receiver of this property access.
objectExpression - the receiver to store Records whether this access uses spread-dot navigation (*.).
spreadSafe - true to mark the access as spread-safeRecords whether this access targets a static member.
isStatic - true to mark the access as staticCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.