KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.aspectj.tools.ajdoc.Access;
25
26 import com.sun.javadoc.RootDoc;
27 import com.sun.tools.doclets.DocletAbortException;
28
29 import java.io.IOException JavaDoc;
30 import java.util.List JavaDoc;
31
32 public class DeprecatedListWriter
33     extends com.sun.tools.doclets.standard.DeprecatedListWriter
34 {
35
36     protected DeprecatedAPIListBuilder builder;
37     
38     public DeprecatedListWriter(String JavaDoc filename,
39                                 DeprecatedAPIListBuilder builder)
40         throws IOException JavaDoc {
41         super(filename);
42         this.builder = builder;
43     }
44
45     public static void generate(RootDoc root) throws DocletAbortException {
46         String JavaDoc filename = "deprecated-list.html";
47         DeprecatedListWriter dw = null;
48         try {
49             (dw = new DeprecatedListWriter(filename,
50                                            new DeprecatedAPIListBuilder(root))).
51                 generateDeprecatedListFile();
52         } catch (IOException JavaDoc e) {
53             Standard.configuration().
54                 standardmessage.error("doclet.exception_encountered",
55                                       e+"", filename);
56             throw new DocletAbortException();
57         } finally {
58             if (dw != null) dw.close();
59         }
60     }
61
62     protected void generateDeprecatedListFile() throws IOException JavaDoc {
63         generateDeprecatedListFile(builder);
64     }
65
66     protected void printDeprecatedFooter() {
67         printRestOfDeprecatedListFile();
68         super.printDeprecatedFooter();
69     }
70
71     protected void printRestOfDeprecatedListFile() {
72         deprecatedListFile(new AdviceSubWriter(this),
73                            builder.getDeprecatedAdivce());
74         deprecatedListFile(new PointcutSubWriter(this),
75                            builder.getDeprecatedPointcuts());
76         deprecatedListFile(new FieldIntroductionSubWriter(this),
77                            builder.getDeprecatedFieldIntroductions());
78         deprecatedListFile(new MethodIntroductionSubWriter(this),
79                            builder.getDeprecatedMethodIntroductions());
80         deprecatedListFile(new ConstructorIntroductionSubWriter(this),
81                            builder.getDeprecatedConstructorIntroductions());
82         deprecatedListFile(new SuperIntroductionSubWriter(this),
83                            builder.getDeprecatedSuperIntroductions());
84         
85                            
86     }
87
88     protected final void deprecatedListFile(AbstractSubWriter mw,
89                                       List JavaDoc list) {
90         Access.printDeprecatedAPI(mw, list,
91                                   "doclet.Deprecated_" +
92                                   mw.keyName() + "s");
93     }
94 }
95
Popular Tags