1 34 package org.codehaus.groovy.ast.expr; 35 36 import org.codehaus.groovy.ast.GroovyCodeVisitor; 37 import org.codehaus.groovy.classgen.AsmClassGenerator2; 38 39 42 public class NegationExpression extends Expression { 43 44 private Expression expression; 45 46 public NegationExpression(Expression expression) { 47 this.expression = expression; 48 } 49 50 public Expression getExpression() { 51 return expression; 52 } 53 54 public void visit(GroovyCodeVisitor visitor) { 55 visitor.visitNegationExpression(this); 56 } 57 58 public Expression transformExpression(ExpressionTransformer transformer) { 59 return new NegationExpression(transformer.transform(expression)); 60 } 61 62 protected void resolveType(AsmClassGenerator2 resolver) { 63 expression.resolve(resolver); 64 setTypeClass(expression.getTypeClass()); 65 } 66 67 public String getText() { 68 return expression.getText(); 69 } 70 71 public String getType() { 72 return expression.getType(); 73 } 74 75 public boolean isDynamic() { 76 return false; } 78 79 public Class getTypeClass() { 80 return expression.getTypeClass(); 81 } 82 } 83 | Popular Tags |