public final class ItemAccessNode extends DataAccessNode
The source location of this node is the location of the [<expr>] and doesn't include
the base expression.
ExprNode.Kind, ExprNode.OperatorNode, ExprNode.ParentExprNode, ExprNode.PrimitiveNodeisNullSafe| Constructor and Description |
|---|
ItemAccessNode(ExprNode base,
ExprNode key,
SourceLocation location,
boolean isNullSafe) |
| Modifier and Type | Method and Description |
|---|---|
ItemAccessNode |
copy(CopyState copyState)
See
Node.copy(CopyState) for a description of the copy contract. |
ExprNode |
getKeyExprChild()
Returns the key expression.
|
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.
|
getBaseExprChild, isNullSafe, toSourceStringaddChild, addChild, addChildren, addChildren, appendSourceStringForChildren, clearChildren, getChild, getChildIndex, getChildren, getType, numChildren, removeChild, removeChild, replaceChild, replaceChild, setTypegetParent, getSourceLocationcouldHaveSyntaxVersionAtLeast, equals, getNearestAncestor, getSyntaxVersionUpperBound, hasAncestor, hashCode, maybeSetSyntaxVersionUpperBound, setParent, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSourceLocation, getSyntaxVersionUpperBound, hasAncestor, maybeSetSyntaxVersionUpperBound, setParentpublic ItemAccessNode(ExprNode base, ExprNode key, SourceLocation location, boolean isNullSafe)
base - The base expression, that is a reference to the object containing the item.key - An expression representing either an array index or a map key.location - The location of the access expressionisNullSafe - 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 ExprNode getKeyExprChild()
public String getSourceStringSuffix()
getSourceStringSuffix in class DataAccessNodepublic ItemAccessNode copy(CopyState copyState)
ExprNodeNode.copy(CopyState) for a description of the copy contract.