KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_lib > deployment > xml > InitParam


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or 1any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * Initial developer: Florent BENOIT
22  * --------------------------------------------------------------------------
23  * $Id: InitParam.java,v 1.2 2004/05/10 12:04:39 sauthieg Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.jonas_lib.deployment.xml;
28
29 /**
30  * This class defines the implementation of the element init-param
31  * @author Florent Benoit
32  */

33 public class InitParam extends AbsElement {
34
35     /**
36      * Name of this parameter
37      */

38     private String JavaDoc paramName = null;
39
40     /**
41      * Value of this parameter
42      */

43     private String JavaDoc paramValue = null;
44
45     /**
46      * Description of the ejb-ref
47      */

48     private String JavaDoc description = null;
49
50     // Setters
51

52     /**
53      * Sets the description
54      * @param description the description to use
55      */

56     public void setDescription(String JavaDoc description) {
57         this.description = description;
58     }
59
60     /**
61      * Sets the name
62      * @param paramName the name to use
63      */

64     public void setParamName(String JavaDoc paramName) {
65         this.paramName = paramName;
66     }
67
68
69     /**
70      * Sets the value
71      * @param paramValue the value
72      */

73     public void setParamValue(String JavaDoc paramValue) {
74         this.paramValue = paramValue;
75     }
76
77
78
79     // Getters
80

81
82     /**
83      * @return the name of the parameter
84      */

85     public String JavaDoc getParamName() {
86         return paramName;
87     }
88
89
90     /**
91      * @return the value of the parameter
92      */

93     public String JavaDoc getParamValue() {
94         return paramValue;
95     }
96
97     /**
98      * @return the description of the parameter
99      */

100     public String JavaDoc getDescription() {
101         return description;
102     }
103
104
105     /**
106      * Represents this element by it's XML description.
107      * @param indent use this indent for prexifing XML representation.
108      * @return the XML description of this object.
109      */

110     public String JavaDoc toXML(int indent) {
111         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
112         sb.append(indent(indent));
113         sb.append("<init-param>\n");
114
115         indent += 2;
116
117         // name
118
sb.append(xmlElement(paramName, "param-name", indent));
119
120         // value
121
sb.append(xmlElement(paramValue, "param-value", indent));
122
123         // value
124
sb.append(xmlElement(description, "description", indent));
125
126         indent -= 2;
127         sb.append(indent(indent));
128         sb.append("</init-param>\n");
129
130         return sb.toString();
131     }
132
133
134
135 }
136
Popular Tags