KickJava   Java API By Example, From Geeks To Geeks.

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


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.ClassDoc;
25 import com.sun.tools.doclets.ClassTree;
26 import com.sun.tools.doclets.DocletAbortException;
27
28 import java.io.IOException JavaDoc;
29 import java.util.List JavaDoc;
30
31 public class TreeWriter
32     extends com.sun.tools.doclets.standard.TreeWriter
33 {
34     protected class Del extends AbstractTreeWriter {
35         public Del(String JavaDoc s, ClassTree c)
36             throws IOException JavaDoc, DocletAbortException {
37             super(s, c);
38         }
39         public void print(String JavaDoc s) {
40             TreeWriter.this.print(s);
41         }
42     }
43     final protected Del del;
44     {
45         Standard.quiet();
46         Del d = null;
47         try {
48             d = new Del(filename, classtree);
49         } catch (Exception JavaDoc e) {
50             Standard.configuration().standardmessage.
51                 error("doclet.exception_encountered",
52                       e+"", filename);
53         } finally {
54             del = d;
55             Standard.speak();
56         }
57     }
58     protected void generateLevelInfo(ClassDoc parent, List JavaDoc list) {
59         del.generateLevelInfo(parent, list);
60     }
61     protected void generateTree(List JavaDoc list, String JavaDoc heading) {
62         del.generateTree(list, heading);
63     }
64
65     public TreeWriter(String JavaDoc filename, ClassTree classtree)
66         throws IOException JavaDoc, DocletAbortException {
67         super(filename, classtree);
68     }
69
70     public static void generate(ClassTree classtree)
71                                 throws DocletAbortException {
72         TreeWriter tw = null;
73         String JavaDoc filename = "overview-tree.html";
74         try {
75             (tw = new TreeWriter(filename, classtree)).
76                 generateTreeFile();
77         } catch (IOException JavaDoc e) {
78             Standard.configuration().standardmessage.
79                 error("doclet.exception_encountered",
80                       e+"", filename);
81             throw new DocletAbortException();
82         } finally {
83             if (tw != null) tw.close();
84         }
85     }
86 }
87
Popular Tags