1 46 package org.codehaus.groovy.ast.expr; 47 48 import org.codehaus.groovy.ast.GroovyCodeVisitor; 49 import org.codehaus.groovy.classgen.AsmClassGenerator; 50 51 58 public class SpreadMapExpression extends Expression { 59 60 private Expression expression; 61 62 public SpreadMapExpression(Expression expression) { 63 this.expression = expression; 64 } 65 66 public Expression getExpression() { 67 return expression; 68 } 69 70 public void visit(GroovyCodeVisitor visitor) { 71 visitor.visitSpreadMapExpression(this); 72 } 73 74 public Expression transformExpression(ExpressionTransformer transformer) { 75 return new SpreadMapExpression(transformer.transform(expression)); 76 } 77 78 protected void resolveType(AsmClassGenerator resolver) { 79 expression.resolve(resolver); 80 setTypeClass(expression.getTypeClass()); 81 } 82 83 public String getText() { 84 return "*:" + expression.getText(); 85 } 86 87 public String getType() { 88 return expression.getType(); 89 } 90 91 public boolean isDynamic() { 92 return false; 93 } 94 95 public Class getTypeClass() { 96 return expression.getTypeClass(); 97 } 98 } 99 | Popular Tags |