1 11 package org.eclipse.jdt.internal.compiler.parser; 12 13 16 import org.eclipse.jdt.internal.compiler.ast.ASTNode; 17 import org.eclipse.jdt.internal.compiler.ast.ImportReference; 18 19 public class RecoveredImport extends RecoveredElement { 20 21 public ImportReference importReference; 22 public RecoveredImport(ImportReference importReference, RecoveredElement parent, int bracketBalance){ 23 super(parent, bracketBalance); 24 this.importReference = importReference; 25 } 26 29 public ASTNode parseTree(){ 30 return importReference; 31 } 32 35 public int sourceEnd(){ 36 return this.importReference.declarationSourceEnd; 37 } 38 public String toString(int tab) { 39 return tabString(tab) + "Recovered import: " + importReference.toString(); } 41 public ImportReference updatedImportReference(){ 42 43 return importReference; 44 } 45 public void updateParseTree(){ 46 this.updatedImportReference(); 47 } 48 51 public void updateSourceEndIfNecessary(int bodyStart, int bodyEnd){ 52 if (this.importReference.declarationSourceEnd == 0) { 53 this.importReference.declarationSourceEnd = bodyEnd; 54 this.importReference.declarationEnd = bodyEnd; 55 } 56 } 57 } 58 | Popular Tags |