1 46 package org.codehaus.groovy.ast.expr; 47 48 import groovy.lang.MetaMethod; 49 50 import org.codehaus.groovy.ast.GroovyCodeVisitor; 51 import org.codehaus.groovy.classgen.AsmClassGenerator2; 52 53 59 public class StaticMethodCallExpression extends Expression { 60 61 String ownerType; 62 private String method; 63 private Expression arguments; 64 private MetaMethod metaMethod = null; 65 66 public StaticMethodCallExpression(String type, String method, Expression arguments) { 67 ownerType = type; 68 this.method = method; 69 this.arguments = arguments; 70 } 71 72 public void visit(GroovyCodeVisitor visitor) { 73 visitor.visitStaticMethodCallExpression(this); 74 } 75 76 public Expression transformExpression(ExpressionTransformer transformer) { 77 return new StaticMethodCallExpression(type, method, transformer.transform(arguments)); 78 } 79 80 protected void resolveType(AsmClassGenerator2 resolver) { 81 arguments.resolve(resolver); 82 resolver.resolve(this); 83 } 84 85 public Expression getArguments() { 86 return arguments; 87 } 88 89 public String getMethod() { 90 return method; 91 } 92 93 public String getText() { 94 return type + "." + method + arguments.getText(); 95 } 96 97 public String toString() { 98 return super.toString() + "[type: " + type + " method: " + method + " arguments: " + arguments + "]"; 99 } 100 public String getOwnerType() { 101 return ownerType; 102 } 103 104 public void setOwnerType(String ownerType) { 105 this.ownerType = ownerType; 106 } 107 108 public void setMetaMethod(MetaMethod metaMethod) { 109 this.metaMethod = metaMethod; 110 } 111 112 public MetaMethod getMetaMethod() { 113 return metaMethod; 114 } 115 116 } 117 | Popular Tags |