1 11 package org.eclipse.jdt.internal.corext.refactoring.code; 12 13 import org.eclipse.jdt.core.dom.ASTNode; 14 import org.eclipse.jdt.core.dom.Expression; 15 import org.eclipse.jdt.core.dom.IMethodBinding; 16 import org.eclipse.jdt.core.dom.ITypeBinding; 17 import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; 18 19 import org.eclipse.jdt.internal.corext.dom.CodeScopeBuilder; 20 21 public class CallContext { 22 23 public ASTNode invocation; 24 public String [] arguments; 25 public String receiver; 26 public boolean receiverIsStatic; 27 public CodeScopeBuilder.Scope scope; 28 public int callMode; 29 public ImportRewrite importer; 30 31 public CallContext(ASTNode inv, CodeScopeBuilder.Scope s, int cm, ImportRewrite i) { 32 super(); 33 invocation= inv; 34 scope= s; 35 callMode= cm; 36 importer= i; 37 } 38 39 public ITypeBinding getReceiverType() { 40 Expression expression= Invocations.getExpression(invocation); 41 if (expression != null) { 42 return expression.resolveTypeBinding(); 43 } 44 IMethodBinding method= Invocations.resolveBinding(invocation); 45 if (method != null) { 46 return method.getDeclaringClass(); 47 } 48 return null; 49 } 50 } 51 | Popular Tags |