1 11 package org.eclipse.jdt.internal.codeassist.complete; 12 13 import org.eclipse.jdt.internal.compiler.ast.MarkerAnnotation; 14 import org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference; 15 import org.eclipse.jdt.internal.compiler.ast.TypeReference; 16 import org.eclipse.jdt.internal.compiler.lookup.Binding; 17 import org.eclipse.jdt.internal.compiler.lookup.BlockScope; 18 import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; 19 20 public class CompletionOnMarkerAnnotationName extends MarkerAnnotation { 21 public CompletionOnMarkerAnnotationName(TypeReference type, int sourceStart){ 22 super(type, sourceStart); 23 } 24 25 public TypeBinding resolveType(BlockScope scope) { 26 if(type instanceof QualifiedTypeReference) { 27 QualifiedTypeReference qualifiedTypeReference = (QualifiedTypeReference) type; 28 Binding binding = scope.parent.getTypeOrPackage(qualifiedTypeReference.tokens); if (!binding.isValidBinding()) { 30 scope.problemReporter().invalidType(this, (TypeBinding) binding); 31 throw new CompletionNodeFound(); 32 } 33 throw new CompletionNodeFound(this, binding, scope); 34 } 35 throw new CompletionNodeFound(this, null, scope); 36 } 37 } 38 | Popular Tags |