1 11 package org.eclipse.jdt.internal.compiler.ast; 12 13 import org.eclipse.jdt.internal.compiler.ASTVisitor; 14 import org.eclipse.jdt.internal.compiler.impl.Constant; 15 import org.eclipse.jdt.internal.compiler.lookup.*; 16 17 public class JavadocImplicitTypeReference extends TypeReference { 18 19 public char[] token; 20 21 public JavadocImplicitTypeReference(char[] name, int pos) { 22 super(); 23 this.token = name; 24 this.sourceStart = pos; 25 this.sourceEnd = pos; 26 } 27 30 public TypeReference copyDims(int dim) { 31 return null; 32 } 33 34 37 protected TypeBinding getTypeBinding(Scope scope) { 38 this.constant = Constant.NotAConstant; 39 return this.resolvedType = scope.enclosingSourceType(); 40 } 41 42 public char[] getLastToken() { 43 return this.token; 44 } 45 46 49 public char[][] getTypeName() { 50 if (this.token != null) { 51 char[][] tokens = { this.token }; 52 return tokens; 53 } 54 return null; 55 } 56 public boolean isThis() { 57 return true; 58 } 59 60 64 private TypeBinding internalResolveType(Scope scope) { 65 this.constant = Constant.NotAConstant; 67 if (this.resolvedType != null) return this.resolvedType.isValidBinding() ? this.resolvedType : null; 70 this.resolvedType = scope.enclosingSourceType(); 71 if (this.resolvedType == null) 72 return null; if (!this.resolvedType.isValidBinding()) { 74 reportInvalidType(scope); 75 return null; 76 } 77 if (isTypeUseDeprecated(this.resolvedType, scope)) 78 reportDeprecatedType(this.resolvedType, scope); 79 return this.resolvedType; 80 } 81 82 protected void reportInvalidType(Scope scope) { 83 scope.problemReporter().javadocInvalidType(this, this.resolvedType, scope.getDeclarationModifiers()); 84 } 85 protected void reportDeprecatedType(TypeBinding type, Scope scope) { 86 scope.problemReporter().javadocDeprecatedType(type, this, scope.getDeclarationModifiers()); 87 } 88 89 public TypeBinding resolveType(BlockScope blockScope, boolean checkBounds) { 90 return internalResolveType(blockScope); 91 } 92 93 public TypeBinding resolveType(ClassScope classScope) { 94 return internalResolveType(classScope); 95 } 96 97 public void traverse(ASTVisitor visitor, BlockScope scope) { 98 visitor.visit(this, scope); 99 visitor.endVisit(this, scope); 100 } 101 102 public void traverse(ASTVisitor visitor, ClassScope scope) { 103 visitor.visit(this, scope); 104 visitor.endVisit(this, scope); 105 } 106 107 public StringBuffer printExpression(int indent, StringBuffer output) { 108 return new StringBuffer (); 109 } 110 } 111 | Popular Tags |