public class FieldExpression
extends Expression
Represents a field access such as the expression "this.foo".
| Fields inherited from class | Fields |
|---|---|
class Expression |
EMPTY_ARRAY |
| Constructor and description |
|---|
FieldExpression(FieldNode field)Creates an access to field. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public FieldNode |
getField()The field this expression reads or writes. |
|
public String |
getFieldName()The name of getField(). |
|
public String |
getText() |
|
public ClassNode |
getType() |
|
public boolean |
isDynamicTyped()Whether the field's declared type is dynamic. |
|
public boolean |
isUseReferenceDirectly()Whether a holder field is read or written as the Reference
itself. |
|
public void |
setType(ClassNode type) |
|
public void |
setUseReferenceDirectly(boolean useRef)Records whether a holder field is loaded or stored as its Reference instead of the value that reference contains. |
|
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 |
Creates an access to field.
Fails with NullPointerException if field is null.
field - the field being read or writtenThe field this expression reads or writes.
The name of getField().
Whether the field's declared type is dynamic.
Whether a holder field is read or written as the Reference
itself. false, the default, loads or stores the value inside that
reference.
true when the reference wrapper is used directly Records whether a holder field is loaded or stored as its
Reference instead of the value that reference contains.
useRef - true to use the reference wrapper directlyCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.