public class MapExpression
extends Expression
Represents a map expression [1 : 2, "a" : "b", x : y] which creates a mutable Map
| Fields inherited from class | Fields |
|---|---|
class Expression |
EMPTY_ARRAY |
| Constructor and description |
|---|
MapExpression()Creates an empty map expression. |
MapExpression(List<MapEntryExpression> mapEntryExpressions)Creates a map expression that keeps mapEntryExpressions as its entries.
|
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
addMapEntryExpression(MapEntryExpression expression)Appends expression to the entry list. |
|
public void |
addMapEntryExpression(Expression keyExpression, Expression valueExpression)Appends a new MapEntryExpression for keyExpression and
valueExpression. |
|
public List<MapEntryExpression> |
getMapEntryExpressions()Returns the entry list retained by this expression. |
|
public String |
getText() |
|
public boolean |
isDynamic()Always returns false. |
|
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 map expression. The entry list is a new ArrayList, and the expression type is ClassHelper.MAP_TYPE.
Creates a map expression that keeps mapEntryExpressions as its entries.
The list is stored, not copied, so later additions append to the caller's list. The expression type is ClassHelper.MAP_TYPE.
mapEntryExpressions - the entry list to retain; must accept add if entries are added later Appends expression to the entry list.
expression - the entry to add Appends a new MapEntryExpression for keyExpression and
valueExpression. Neither expression is copied.
keyExpression - the keyvalueExpression - the valueReturns the entry list retained by this expression. The list is not copied, so changes to it change this expression.
Always returns false.
falseCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.