KickJava   Java API By Example, From Geeks To Geeks.

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


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.IntroducedDoc;
25
26 import com.sun.javadoc.ClassDoc;
27 import com.sun.javadoc.ProgramElementDoc;
28 import com.sun.tools.doclets.VisibleMemberMap;
29
30 public class FieldSubWriter extends AbstractSubWriter {
31
32     public static class Del extends com.sun.tools.doclets.standard.FieldSubWriter {
33         protected FieldSubWriter mw;
34         public Del(com.sun.tools.doclets.standard.SubWriterHolderWriter writer,
35                    ClassDoc classdoc)
36         {
37             super(writer, classdoc);
38         }
39         public Del(com.sun.tools.doclets.standard.SubWriterHolderWriter writer)
40         {
41             super(writer);
42         }
43         public void printMembersSummary() {
44             mw.printMembersSummary();
45             mw.printIntroducedMembersSummary();
46         }
47         public void printMembers() {
48             if (writer instanceof ClassWriter) {
49                 ((ClassWriter)writer).printAspectJDetail();
50             }
51             mw.printMembers();
52         }
53         protected void navSummaryLink() {
54             mw.navSummaryLink();
55         }
56         protected void navDetailLink() {
57             if (writer instanceof ClassWriter) {
58                 ((ClassWriter)writer).navstate++;
59             }
60             mw.navDetailLink();
61         }
62         public void setDelegator(FieldSubWriter mw) { this.mw = mw; }
63         public void printSummaryMember(ClassDoc cd, ProgramElementDoc member) {
64             mw.printSummaryMember(cd, member);
65         }
66     }
67     
68     protected Class JavaDoc delegateClass() {
69         return Del.class;
70     }
71
72     public FieldSubWriter
73         (com.sun.tools.doclets.standard.SubWriterHolderWriter writer,
74          ClassDoc classdoc)
75     {
76         super(writer, classdoc);
77     }
78     
79     public FieldSubWriter
80         (com.sun.tools.doclets.standard.SubWriterHolderWriter writer)
81     {
82         super(writer);
83     }
84
85       public int getMemberKind() {
86           //XXX hack!!!
87
return VisibleMemberMap.FIELDS;
88       }
89
90     protected String JavaDoc propertyName() { return "Field"; }
91
92     public void printIntroducedSummaryLink(ClassDoc cd,
93                                            ProgramElementDoc member) {
94         writer.printClassLink(cd, member.name(), member.name(), false);
95     }
96
97     public void printCrosscuts(ClassDoc cd, ProgramElementDoc member) {
98         org.aspectj.ajdoc.FieldDoc field = (org.aspectj.ajdoc.FieldDoc)member;
99         IntroducedDoc intro = field.introduced();
100         if (intro != null) {
101             writer.dt();
102             writer.boldText("doclet.Introduced_from");
103             writer.dd();
104             writer.printClassLink(intro.containingClass(),
105                                   Statics.where(intro.member()));
106         }
107     }
108
109     public void printSummaryCrosscuts(ClassDoc cd, ProgramElementDoc member) {}
110
111     public boolean hasCrosscuts(ClassDoc classDoc, ProgramElementDoc member) {
112         return true || ((org.aspectj.ajdoc.MemberDoc)member).introduced() != null;
113     }
114 }
115     
116     
117
Popular Tags