public class ArrayExpression extends Expression
Represents an array object construction. One of:
new String[3]
or new Integer[2][3])
new String[]{ "foo", "bar" }
)Fields inherited from class | Fields |
---|---|
class Expression |
EMPTY_ARRAY |
Constructor and description |
---|
ArrayExpression(ClassNode elementType, List<Expression> initExpressions, List<Expression> sizeExpressions) |
ArrayExpression(ClassNode elementType, List<Expression> initExpressions) Creates an array using an initializer (list of expressions corresponding to array elements). |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
addExpression(Expression initExpression) Adds another element to the initializer expressions. |
|
public ClassNode |
getElementType() |
|
public Expression |
getExpression(int i) Gets a specific initializer expression. |
|
public List<Expression> |
getExpressions() Gets the initializer expressions. |
|
public List<Expression> |
getSizeExpression()
|
|
public String |
getText() |
|
public boolean |
hasInitializer()
|
|
public boolean |
isDynamic() |
|
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 array using an initializer (list of expressions corresponding to array elements).
Adds another element to the initializer expressions.
Gets a specific initializer expression.
Gets the initializer expressions.
Copyright © 2003-2024 The Apache Software Foundation. All rights reserved.