KickJava   Java API By Example, From Geeks To Geeks.

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


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.ajdoc.AspectDoc;
25
26 import com.sun.javadoc.ClassDoc;
27 import com.sun.javadoc.ProgramElementDoc;
28 import com.sun.javadoc.Type;
29 import com.sun.tools.doclets.VisibleMemberMap;
30
31 public class ClassSubWriter extends AbstractSubWriter {
32
33     public static class Del extends com.sun.tools.doclets.standard.ClassSubWriter {
34         protected ClassSubWriter mw;
35         public Del(com.sun.tools.doclets.standard.SubWriterHolderWriter writer,
36                    ClassDoc classdoc)
37         {
38             super(writer, classdoc);
39         }
40         public Del(com.sun.tools.doclets.standard.SubWriterHolderWriter writer)
41         {
42             super(writer);
43         }
44         public void printMembersSummary() {
45             mw.printMembersSummary();
46             mw.printIntroducedMembersSummary();
47             if (writer instanceof ClassWriter) {
48                 ((ClassWriter)writer).printAspectJSummary();
49             }
50         }
51         public void printMembers() {
52             mw.printMembers();
53         }
54         protected void navSummaryLink() {
55             mw.navSummaryLink();
56             if (writer instanceof ClassWriter) {
57                 ((ClassWriter)writer).navstate++;
58             }
59         }
60         protected void navDetailLink() {
61             mw.navDetailLink();
62         }
63         public void setDelegator(ClassSubWriter mw) { this.mw = mw; }
64     }
65
66     protected Class JavaDoc delegateClass() {
67         return Del.class;
68     }
69
70     public ClassSubWriter
71         (com.sun.tools.doclets.standard.SubWriterHolderWriter writer,
72          ClassDoc classdoc)
73     {
74         super(writer, classdoc);
75     }
76     
77     public ClassSubWriter
78         (com.sun.tools.doclets.standard.SubWriterHolderWriter writer)
79     {
80         super(writer);
81     }
82     
83     public int getMemberKind() {
84         //XXX hack!!!
85
return VisibleMemberMap.INNERCLASSES;
86     }
87     
88     protected void printSummaryType(ProgramElementDoc member) {
89         ClassDoc cd = (ClassDoc)member;
90         printModifierAndType(cd, null);
91     }
92
93     protected void printModifierAndType(ProgramElementDoc member,
94                                         Type type) {
95         writer.printTypeSummaryHeader();
96         printModifier(member);
97         if (type == null) {
98             print(member instanceof AspectDoc ?
99                   "aspect" : member.isClass() ?
100                   "class" :
101                   "interface");
102         } else {
103             printTypeLink(type);
104         }
105         writer.printTypeSummaryFooter();
106     }
107 }
108     
109     
110
Popular Tags