KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > aspectj > tools > ajdoc > ThrowsTagImpl


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.ajdoc;
23
24 import com.sun.javadoc.ClassDoc;
25 import com.sun.javadoc.Doc;
26 import com.sun.javadoc.ThrowsTag;
27
28 import java.util.Locale JavaDoc;
29
30 /**
31  * Represents a throws tag in the aspectj-world.
32  *
33  * @author Jeff Palm
34  */

35 public class ThrowsTagImpl extends TagImpl implements ThrowsTag {
36
37     private ClassDoc exception;
38     private String JavaDoc exceptionComment;
39     private String JavaDoc exceptionName;
40
41     /**
42      * Constructs the new tag with given parameters and
43      * splits the text.
44      *
45      * @param doc the new value for <code>doc</code>.
46      * @param name the new value for <code>name</code>.
47      * @param text the new value for <code>text</code>.
48      * @param locale the new value for <code>locale</code>.
49      * @param err the new value for <code>err</code>.
50      */

51     public ThrowsTagImpl(Doc doc,
52                          String JavaDoc name,
53                          String JavaDoc text,
54                          Locale JavaDoc loc,
55                          ErrPrinter err) {
56         super(doc, name, text, loc, err);
57         String JavaDoc[] split = split(text);
58         exceptionName = split[0];
59         exceptionComment = split[1];
60         exception = findException();
61     }
62
63     /**
64      * Returns the exception thrown.
65      *
66      * @return a ClassDoc that represents the thrown exception.
67      */

68     public ClassDoc exception() {
69         return exception;
70     }
71
72     /**
73      * Returns the comment text.
74      *
75      * @return a String of the comment text.
76      */

77     public String JavaDoc exceptionComment() {
78         return exceptionComment;
79     }
80
81     /**
82      * Returns the name of the type of exception thrown.
83      *
84      * @return a String name of the type of exception thrown.
85      */

86     public String JavaDoc exceptionName() {
87         return exceptionName;
88     }
89
90     /**
91      * Returns <code>throws</code>.
92      *
93      * @return <code>throws</code>.
94      */

95     public String JavaDoc kind() {
96         return "@throws";
97     }
98
99     //XXX
100
//TODO: implement FUUUUUUCCCCCCCCCKKKKKKKKKKKK
101
private ClassDoc findException() {
102         return null;
103     }
104 }
105
Popular Tags