public class ListExpression
extends Expression
Represents a list expression [1, 2, 3] which creates a mutable List
| Fields inherited from class | Fields |
|---|---|
class Expression |
EMPTY_ARRAY |
| Constructor and description |
|---|
ListExpression()Creates an empty list expression. |
ListExpression(List<Expression> expressions)Creates a list expression that holds expressions directly.
|
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
addExpression(Expression expression)Appends expression to the list held by this node. |
|
public Expression |
getExpression(int i)Returns the element at index i. |
|
public List<Expression> |
getExpressions()Returns the element list held by this node. |
|
public String |
getText() |
|
public boolean |
isWrapped()Reports the flag stored by setWrapped. |
|
public void |
setWrapped(boolean value)Records whether this list was parsed as a bracket-delimited sequence of elements. |
|
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 empty list expression. The element list can be filled later with addExpression.
Creates a list expression that holds expressions directly.
The type of this node is List.
expressions - elements of the list; later calls mutate this list Appends expression to the list held by this node.
expression - element to append Returns the element at index i. An index outside the list fails.
i - zero-based index into getExpressionsReturns the element list held by this node. Callers may mutate it.
Reports the flag stored by setWrapped.
true when this list is a bracket-delimited sequenceRecords whether this list was parsed as a bracket-delimited sequence of elements. The parser sets this for a multi-element index, a named-argument list, or an enum constant with more than one named argument, and clears it for a one-element spread index. A newly built list is not wrapped.
value - true when the list is that bracketed formCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.