public final class NamedArgument extends ExpressionStatement<NamedArgument>
Represents nodes such as:
foo(b=42, a=bar("answer"))
Modifier and Type | Method and Description |
---|---|
void |
accept(GoloIrVisitor visitor)
Accept the visitor.
|
java.util.List<GoloElement<?>> |
children()
Returns a list of all the direct children of this node.
|
ExpressionStatement<?> |
expression() |
java.lang.String |
getName() |
boolean |
hasLocalDeclarations()
Checks if this expression has local variable declarations.
|
static NamedArgument |
of(java.lang.String name,
java.lang.Object value) |
protected void |
replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected NamedArgument |
self() |
NamedArgument |
with(java.lang.Object a)
Defines a variable declaration (assignment) local to this expression.
|
call, clearDeclarations, declarations, of
ancestor, ancestor, ancestorOfType, cantConvert, cantReplace, cantReplace, children, children, descendants, descendants, descendants, documentation, documentation, doesNotContain, enclosingModule, getLocalReferenceTable, hasParent, hasPosition, makeParentOf, metadata, metadata, next, next, next, ofAST, parent, positionInSourceCode, positionInSourceCode, previous, previous, previous, replaceInParentBy, walk
public static NamedArgument of(java.lang.String name, java.lang.Object value)
protected NamedArgument self()
self
in class GoloElement<NamedArgument>
public java.lang.String getName()
public ExpressionStatement<?> expression()
public NamedArgument with(java.lang.Object a)
Always throws an exception since NamedArgument
can't have a local declaration.
with
in class ExpressionStatement<NamedArgument>
public boolean hasLocalDeclarations()
ExpressionStatement
hasLocalDeclarations
in class ExpressionStatement<NamedArgument>
public void accept(GoloIrVisitor visitor)
This method should only call the visitor visitXXXX
method.
The children of this node will be visited by the
GoloElement.walk(GoloIrVisitor)
method.
accept
in class GoloElement<NamedArgument>
public java.util.List<GoloElement<?>> children()
children
in class GoloElement<NamedArgument>
protected void replaceElement(GoloElement<?> original, GoloElement<?> newElement)
Replace original
with newElement
if original
is a child of this node
and type matches.
replaceElement
in class GoloElement<NamedArgument>
original
- the original value to replace. Must be a child of this nodenewElement
- the element to replace with. Type must match.GoloElement.cantReplace()
,
GoloElement.cantReplace(GoloElement, GoloElement)
,
GoloElement.doesNotContain(GoloElement)
,
GoloElement.cantConvert(String, Object)