public final class FieldAccessNode extends DataAccessNode
ExprNode.ConstantNode, ExprNode.Kind, ExprNode.OperatorNode, ExprNode.ParentExprNode, ExprNode.PrimitiveNodeisNullSafeSPACES| Constructor and Description |
|---|
FieldAccessNode(ExprNode base,
String fieldName,
boolean isNullSafe) |
| Modifier and Type | Method and Description |
|---|---|
FieldAccessNode |
clone()
Copies this node.
|
boolean |
equals(Object other) |
String |
getFieldName()
Returns the field name.
|
ExprNode.Kind |
getKind()
Gets this node's kind (corresponding to this node's specific type).
|
String |
getSourceStringSuffix()
Returns the source string for the part of the expression that accesses
the item - in other words, not including the base expression.
|
int |
hashCode() |
getBaseExprChild, isNullSafe, toSourceStringaddChild, addChild, addChildren, addChildren, appendSourceStringForChildren, appendTreeStringForChildren, clearChildren, getChild, getChildIndex, getChildren, getType, numChildren, removeChild, removeChild, replaceChild, replaceChild, setType, toTreeStringgetParent, getSourceLocationcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParent, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSourceLocation, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParentpublic FieldAccessNode(ExprNode base, String fieldName, boolean isNullSafe)
base - The base expression, that is a reference to the object
containing the named field.fieldName - The name of the field.isNullSafe - If true, checks during evaluation whether the base expression is null
and returns null instead of causing an invalid dereference.public ExprNode.Kind getKind()
ExprNodepublic String getFieldName()
public String getSourceStringSuffix()
getSourceStringSuffix in class DataAccessNodepublic FieldAccessNode clone()
NodeAll clone() overrides should follow this contract:
{@literal @}Override public T clone() {
return new T(this);
}
NOTE: this means we do not ultimately delegate to Object.clone(), ever.
TODO(lukes): The usecases for a clone method are few and far between. Making the AST nodes immutable (or at least unmodifiable) would be preferable to maintaining our clone() methods.