1 11 package org.eclipse.jdt.internal.codeassist.complete; 12 13 34 35 import org.eclipse.jdt.internal.compiler.ast.*; 36 import org.eclipse.jdt.internal.compiler.lookup.*; 37 38 public class CompletionOnMemberAccess extends FieldReference { 39 40 public boolean isInsideAnnotation; 41 42 public CompletionOnMemberAccess(char[] source, long pos, boolean isInsideAnnotation) { 43 44 super(source, pos); 45 this.isInsideAnnotation = isInsideAnnotation; 46 } 47 48 public StringBuffer printExpression(int indent, StringBuffer output) { 49 50 output.append("<CompleteOnMemberAccess:"); return super.printExpression(0, output).append('>'); 52 } 53 54 public TypeBinding resolveType(BlockScope scope) { 55 56 this.receiverType = receiver.resolveType(scope); 57 58 if (this.receiverType == null && receiver instanceof MessageSend) { 59 MessageSend messageSend = (MessageSend) receiver; 60 if(messageSend.receiver instanceof ThisReference) { 61 Expression[] arguments = messageSend.arguments; 62 int length = arguments == null ? 0 : arguments.length; 63 TypeBinding[] argBindings = new TypeBinding[length]; 64 for (int i = 0; i < length; i++) { 65 argBindings[i] = arguments[i].resolvedType; 66 if(argBindings[i] == null || !argBindings[i].isValidBinding()) { 67 throw new CompletionNodeFound(); 68 } 69 } 70 71 ProblemMethodBinding problemMethodBinding = new ProblemMethodBinding(messageSend.selector, argBindings, ProblemReasons.NotFound); 72 throw new CompletionNodeFound(this, problemMethodBinding, scope); 73 } 74 } 75 76 if (this.receiverType == null || this.receiverType.isBaseType()) 77 throw new CompletionNodeFound(); 78 else 79 throw new CompletionNodeFound(this, this.receiverType, scope); 80 } 82 } 83 | Popular Tags |