1 22 package org.aspectj.tools.doclets.standard; 23 24 import com.sun.javadoc.ClassDoc; 25 import com.sun.javadoc.MemberDoc; 26 import com.sun.tools.doclets.DirectoryManager; 27 import com.sun.tools.doclets.DocletAbortException; 28 import com.sun.tools.doclets.IndexBuilder; 29 30 import java.io.IOException ; 31 32 public class SplitIndexWriter 33 extends com.sun.tools.doclets.standard.SplitIndexWriter 34 { 35 36 protected class Del extends AbstractIndexWriter { 37 public Del(String s, IndexBuilder i) throws IOException { 38 super(s, i); 39 } 40 public void print(String s) { 41 SplitIndexWriter.this.print(s); 42 } 43 } 44 final protected Del del; 45 { 46 Standard.quiet(); 47 Del d = null; 48 try { 49 d = new Del(filename, indexbuilder); 50 } catch (Exception e) { 51 Standard.configuration().standardmessage. 52 error("doclet.exception_encountered", 53 e+"", filename); 54 } finally { 55 del = d; 56 Standard.speak(); 57 } 58 } 59 protected void printMemberDesc(MemberDoc member) { 60 del.printMemberDesc(member); 61 } 62 protected void printClassInfo(ClassDoc cd) { 63 del.printClassInfo(cd); 64 } 65 66 public SplitIndexWriter(String path, String filename, 67 String relpath, IndexBuilder indexbuilder, 68 int prev, int next) throws IOException { 69 super(path, filename, relpath, 70 indexbuilder, prev, next); 71 } 72 73 public static void generate(IndexBuilder indexbuilder) 74 throws DocletAbortException { 75 SplitIndexWriter sw = null; 76 String filename = ""; 77 String path = DirectoryManager.getPath("index-files"); 78 String relpath = DirectoryManager.getRelativePath("index-files"); 79 try { 80 for (int i = 0; i < indexbuilder.elements().length; i++) { 81 int j = i + 1; 82 int prev = (j == 1)? -1: i; 83 int next = (j == indexbuilder.elements().length)? -1: j + 1; 84 filename = "index-" + j +".html"; 85 (sw = new SplitIndexWriter(path, filename, relpath, 86 indexbuilder, prev, next)). 87 generateIndexFile((Character ) 88 indexbuilder.elements()[i]); 89 } 90 } catch (IOException e) { 91 Standard.configuration(). 92 standardmessage.error("doclet.exception_encountered", 93 e+"", filename); 94 throw new DocletAbortException(); 95 } finally { 96 if (sw != null) sw.close(); 97 } 98 } 99 } 100 | Popular Tags |