1 22 package org.aspectj.tools.doclets.standard; 23 24 import com.sun.javadoc.ClassDoc; 25 import com.sun.javadoc.PackageDoc; 26 import com.sun.tools.doclets.ClassTree; 27 import com.sun.tools.doclets.DirectoryManager; 28 import com.sun.tools.doclets.DocletAbortException; 29 30 import java.io.IOException ; 31 import java.util.List ; 32 33 public class PackageTreeWriter 34 extends com.sun.tools.doclets.standard.PackageTreeWriter 35 { 36 37 protected class Del extends AbstractTreeWriter { 38 public Del(String s, ClassTree c) 39 throws IOException , DocletAbortException { 40 super(s, c); 41 } 42 public void print(String s) { 43 PackageTreeWriter.this.print(s); 44 } 45 } 46 final protected Del del; 47 { 48 Standard.quiet(); 49 Del d = null; 50 try { 51 d = new Del(filename, classtree); 52 } catch (Exception e) { 53 Standard.configuration().standardmessage. 54 error("doclet.exception_encountered", 55 e+"", filename); 56 } finally { 57 del = d; 58 Standard.speak(); 59 } 60 } 61 protected void generateLevelInfo(ClassDoc parent, List list) { 62 del.generateLevelInfo(parent, list); 63 } 64 protected void generateTree(List list, String heading) { 65 del.generateTree(list, heading); 66 } 67 68 public PackageTreeWriter(String path, 69 String filename, 70 PackageDoc packagedoc, 71 PackageDoc prev, 72 PackageDoc next, 73 boolean noDeprecated) 74 throws IOException , DocletAbortException { 75 super(path, filename, packagedoc, prev, next, noDeprecated); 76 } 77 78 public static void generate(PackageDoc pkg, PackageDoc prev, 79 PackageDoc next, boolean noDeprecated) 80 throws DocletAbortException { 81 PackageTreeWriter pw = null; 82 String path = DirectoryManager.getDirectoryPath(pkg); 83 String filename = "package-tree.html"; 84 try { 85 (pw = new PackageTreeWriter(path, filename, pkg, 86 prev, next, noDeprecated)). 87 generatePackageTreeFile(); 88 } catch (IOException e) { 89 Standard.configuration().standardmessage. 90 error("doclet.exception_encountered", 91 e+"", filename); 92 throw new DocletAbortException(); 93 } finally { 94 if (pw != null) pw.close(); 95 } 96 } 97 } 98 | Popular Tags |