KickJava   Java API By Example, From Geeks To Geeks.

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


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.AdviceDoc;
25
26 import com.sun.javadoc.ClassDoc;
27 import com.sun.javadoc.ExecutableMemberDoc;
28 import com.sun.javadoc.MethodDoc;
29 import com.sun.javadoc.ProgramElementDoc;
30 import com.sun.tools.doclets.VisibleMemberMap;
31
32 public class MethodSubWriter extends ExecutableMemberSubWriter {
33
34     public static class Del
35         extends com.sun.tools.doclets.standard.MethodSubWriter {
36         protected MethodSubWriter mw;
37         public Del(com.sun.tools.doclets.standard.SubWriterHolderWriter writer,
38                    ClassDoc classdoc)
39         {
40             super(writer, classdoc);
41         }
42         public Del(com.sun.tools.doclets.standard.SubWriterHolderWriter writer)
43         {
44             super(writer);
45         }
46         public void printMembersSummary() {
47             mw.printMembersSummary();
48             mw.printIntroducedMembersSummary();
49         }
50         public void printMembers() {
51             mw.printMembers();
52         }
53         protected void navSummaryLink() {
54             mw.navSummaryLink();
55         }
56         protected void navDetailLink() {
57             mw.navDetailLink();
58         }
59         public void setDelegator(MethodSubWriter mw) { this.mw = mw; }
60         public void printSummaryMember(ClassDoc cd, ProgramElementDoc member) {
61             mw.printSummaryMember(cd, member);
62         }
63     }
64
65     protected Class JavaDoc delegateClass() { return Del.class; }
66
67     public MethodSubWriter
68         (com.sun.tools.doclets.standard.SubWriterHolderWriter writer,
69          ClassDoc classdoc)
70     {
71         super(writer, classdoc);
72     }
73
74     public MethodSubWriter
75         (com.sun.tools.doclets.standard.SubWriterHolderWriter writer)
76     {
77         super(writer);
78     }
79
80     public int getMemberKind() {
81         //XXX hack!!!
82
return VisibleMemberMap.METHODS;
83     }
84
85     //XXX
86
//hacks
87
protected void printSummaryType(ProgramElementDoc member) {
88         if (member instanceof MethodDoc) {
89             //TODO: Put in Access...
90
MethodDoc meth = (MethodDoc)member;
91             printModifierAndType(meth, meth.returnType());
92         } else if (member instanceof AdviceDoc) {
93             AdviceDoc advice = (AdviceDoc)member;
94             printModifierAndType(advice, advice.returnType());
95         }
96     }
97     protected void printSignature(ExecutableMemberDoc member) {
98         writer.displayLength = 0;
99         writer.pre();
100         printModifiers(member);
101         //printReturnType((MethodDoc)member);
102
bold(member.name());
103         // printParameters(member);
104
// printExceptions(member);
105
writer.preEnd();
106     }
107     //end-hacks
108

109     protected String JavaDoc propertyName() { return "Method"; }
110 }
111
112
113
Popular Tags