KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > aspectj > tools > doclets > standard > SingleIndexWriter


1 /* -*- Mode: JDE; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2  *
3  * This file is part of the debugger and core tools for the AspectJ(tm)
4  * programming language; see http://aspectj.org
5  *
6  * The contents of this file are subject to the Mozilla Public License
7  * Version 1.1 (the "License"); you may not use this file except in
8  * compliance with the License. You may obtain a copy of the License at
9  * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13  * for the specific language governing rights and limitations under the
14  * License.
15  *
16  * The Original Code is AspectJ.
17  *
18  * The Initial Developer of the Original Code is Xerox Corporation. Portions
19  * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation.
20  * All Rights Reserved.
21  */

22 package org.aspectj.tools.doclets.standard;
23
24 import com.sun.javadoc.MemberDoc;
25
26 import com.sun.javadoc.ClassDoc;
27 import com.sun.tools.doclets.DocletAbortException;
28 import com.sun.tools.doclets.IndexBuilder;
29
30 import java.io.IOException JavaDoc;
31
32 public class SingleIndexWriter
33     extends com.sun.tools.doclets.standard.SingleIndexWriter
34 {
35
36     protected class Del extends AbstractIndexWriter {
37         public Del(String JavaDoc s, IndexBuilder i) throws IOException JavaDoc {
38             super(s, i);
39         }
40         public void print(String JavaDoc s) {
41             SingleIndexWriter.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 JavaDoc 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 SingleIndexWriter(String JavaDoc filename,
67                              IndexBuilder indexbuilder) throws IOException JavaDoc {
68         super(filename, indexbuilder);
69     }
70
71     public static void generate(IndexBuilder indexbuilder)
72                                 throws DocletAbortException {
73         SingleIndexWriter sw = null;
74         String JavaDoc filename = "index-all.html";
75         try {
76             (sw = new SingleIndexWriter(filename, indexbuilder)).
77                 generateIndexFile();
78         } catch (IOException JavaDoc e) {
79             Standard.configuration().standardmessage.error
80                 ("doclet.exception_encountered",
81                  e+"", filename);
82             throw new DocletAbortException();
83         } finally {
84             if (sw != null) sw.close();
85         }
86     }
87 }
88
Popular Tags