KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > xml > xmlc > codegen > JavaParameter


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  *
21  * $Id: JavaParameter.java,v 1.1.1.1 2003/03/10 16:36:19 taweili Exp $
22  */

23
24 package org.enhydra.xml.xmlc.codegen;
25
26 /**
27  * Class to store a method parameter.
28  * Objects of this class are immutable.
29  */

30 public final class JavaParameter extends JavaVariable {
31     /**
32      * Constructor with doc array.
33      * @param name The parameter name.
34      * @param type The parameter type.
35      * @param doc The parameter documentation, where each row is a line of the
36      * document. If null, no documention is created.
37      * @see JavaModifiers
38      */

39     public JavaParameter(String JavaDoc name,
40                          String JavaDoc type,
41                          String JavaDoc[] doc) {
42         super(name, type, 0, doc);
43     }
44
45     /**
46      * Constructor with doc string.
47      * @param name The parameter name.
48      * @param type The parameter type.
49      * @param doc The parameter documentation.
50      * If null, no documention is created.
51      * @see JavaModifiers
52      */

53     public JavaParameter(String JavaDoc name,
54                          String JavaDoc type,
55                          String JavaDoc doc) {
56         super(name, type, 0, doc);
57     }
58
59     /**
60      * Print the param JavaDoc entry for this parameter, if there is any.
61      */

62     public void printJavaDoc(IndentWriter out) {
63         String JavaDoc[] doc = getDoc();
64         if (doc != null) {
65             out.print(" * @param ");
66             out.print(getName());
67             out.print(' ');
68             out.println(doc[0]);
69             for (int idx = 1; idx < doc.length; idx++) {
70                 out.print(" * ");
71                 out.println(doc[idx]);
72             }
73         }
74     }
75 }
76
Popular Tags