KickJava   Java API By Example, From Geeks To Geeks.

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


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 import org.aspectj.ajdoc.IntroducedDoc;
26
27 import com.sun.javadoc.ClassDoc;
28 import com.sun.javadoc.MemberDoc;
29 import com.sun.tools.doclets.IndexBuilder;
30
31 import java.io.IOException JavaDoc;
32
33 public class AbstractIndexWriter
34     extends com.sun.tools.doclets.standard.AbstractIndexWriter
35 {
36
37     protected AbstractIndexWriter(String JavaDoc path,
38                                   String JavaDoc filename,
39                                   String JavaDoc relativePath,
40                                   IndexBuilder indexbuilder)
41                                   throws IOException JavaDoc {
42         super(path, filename, relativePath, indexbuilder);
43     }
44
45     protected AbstractIndexWriter(String JavaDoc filename,
46                                   IndexBuilder indexbuilder)
47                                   throws IOException JavaDoc {
48         super(filename, indexbuilder);
49     }
50
51     protected void printClassInfo(ClassDoc cd) {
52         if (cd instanceof AspectDoc) {
53             print("aspect ");
54             printPreQualifiedClassLink(cd);
55             print('.');
56         } else {
57             super.printClassInfo(cd);
58         }
59     }
60
61     protected void printMemberDesc(MemberDoc member) {
62         String JavaDoc classdesc = Statics.type(member.containingClass()) + " " +
63             getPreQualifiedClassLink(member.containingClass());
64         if (member instanceof org.aspectj.ajdoc.MemberDoc) {
65             org.aspectj.ajdoc.MemberDoc md = (org.aspectj.ajdoc.MemberDoc)member;
66             if (md.isAdvice()) {
67                 printText("doclet.Advice_in", classdesc);
68             } else if (md.isPointcut()) {
69                 printText("doclet.Pointcut_in", classdesc);
70             }
71         } else {
72             super.printMemberDesc(member);
73         }
74         if (member instanceof org.aspectj.ajdoc.MemberDoc) {
75             IntroducedDoc intro =
76                 ((org.aspectj.ajdoc.MemberDoc)member).introduced();
77             if (intro != null) {
78                 print(' ');
79                 printText("doclet.introduced_by",
80                           Statics.type(intro.containingClass()) + " " +
81                           getPreQualifiedClassLink(intro.containingClass()));
82             }
83         }
84     }
85 }
86
Popular Tags