KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_rar > deployment > xml > Connector


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  *
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or 1any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  *
22  * Initial developer: Florent BENOIT
23  * --------------------------------------------------------------------------
24  * $Id: Connector.java,v 1.2 2003/11/11 20:03:28 ehardesty Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_rar.deployment.xml;
28
29 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
30 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
31 import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
32
33 /**
34  * This class defines the implementation of the element connector
35  *
36  * @author Florent Benoit
37  */

38
39 public class Connector extends AbsElement implements TopLevelElement {
40
41     /**
42      * display-name
43      */

44     private String JavaDoc displayName = null;
45
46     /**
47      * description
48      */

49     private JLinkedList descriptionList = null;
50
51     /**
52      * icon
53      */

54     private Icon icon = null;
55
56     /**
57      * vendor-name
58      */

59     private String JavaDoc vendorName = null;
60
61     /**
62      * spec-version
63      */

64     private String JavaDoc specVersion = null;
65
66     /**
67      * eis-type
68      */

69     private String JavaDoc eisType = null;
70
71     /**
72      * version
73      */

74     private String JavaDoc version = null;
75
76     /**
77      * resourceadapter-version
78      */

79     private String JavaDoc resourceadapterVersion = null;
80
81     /**
82      * license
83      */

84     private License license = null;
85
86     /**
87      * resourceadapter
88      */

89     private Resourceadapter resourceadapter = null;
90
91
92     /**
93      * Constructor
94      */

95     public Connector() {
96         super();
97         descriptionList = new JLinkedList("description");
98     }
99
100     /**
101      * Gets the display-name
102      * @return the display-name
103      */

104     public String JavaDoc getDisplayName() {
105         return displayName;
106     }
107
108     /**
109      * Set the display-name
110      * @param displayName displayName
111      */

112     public void setDisplayName(String JavaDoc displayName) {
113         this.displayName = displayName;
114     }
115
116     /**
117      * Gets the description
118      * @return the description
119      */

120     public JLinkedList getDescriptionList() {
121         return descriptionList;
122     }
123
124     /**
125      * Set the description
126      * @param descriptionList description
127      */

128     public void setDescriptionList(JLinkedList descriptionList) {
129         this.descriptionList = descriptionList;
130     }
131
132     /**
133      * Add a new description element to this object
134      * @param description the description String
135      */

136     public void addDescription(String JavaDoc description) {
137         descriptionList.add(description);
138     }
139
140
141     /**
142      * Gets the icon
143      * @return the icon
144      */

145     public Icon getIcon() {
146         return icon;
147     }
148
149     /**
150      * Set the icon
151      * @param icon icon
152      */

153     public void setIcon(Icon icon) {
154         this.icon = icon;
155     }
156
157
158     /**
159      * Gets the vendor-name
160      * @return the vendor-name
161      */

162     public String JavaDoc getVendorName() {
163         return vendorName;
164     }
165
166     /**
167      * Set the vendor-name
168      * @param vendorName vendorName
169      */

170     public void setVendorName(String JavaDoc vendorName) {
171         this.vendorName = vendorName;
172     }
173
174     /**
175      * Gets the spec-version
176      * @return the spec-version
177      */

178     public String JavaDoc getSpecVersion() {
179         return specVersion;
180     }
181
182     /**
183      * Set the spec-version
184      * @param specVersion specVersion
185      */

186     public void setSpecVersion(String JavaDoc specVersion) {
187         this.specVersion = specVersion;
188     }
189
190     /**
191      * Gets the eis-type
192      * @return the eis-type
193      */

194     public String JavaDoc getEisType() {
195         return eisType;
196     }
197
198     /**
199      * Set the eis-type
200      * @param eisType eisType
201      */

202     public void setEisType(String JavaDoc eisType) {
203         this.eisType = eisType;
204     }
205
206     /**
207      * Gets the version
208      * @return the version
209      */

210     public String JavaDoc getVersion() {
211         return version;
212     }
213
214     /**
215      * Set the version
216      * @param version version
217      */

218     public void setVersion(String JavaDoc version) {
219         this.version = version;
220     }
221
222     /**
223      * Gets the resourceadapter-version
224      * @return the resourceadapter-version
225      */

226     public String JavaDoc getResourceadapterVersion() {
227         return resourceadapterVersion;
228     }
229
230     /**
231      * Set the resourceadapter-version
232      * @param resourceadapterVersion resourceadapterVersion
233      */

234     public void setResourceadapterVersion(String JavaDoc resourceadapterVersion) {
235         this.resourceadapterVersion = resourceadapterVersion;
236     }
237
238     /**
239      * Gets the license
240      * @return the license
241      */

242     public License getLicense() {
243         return license;
244     }
245
246     /**
247      * Set the license
248      * @param license license
249      */

250     public void setLicense(License license) {
251         this.license = license;
252     }
253
254     /**
255      * Gets the resourceadapter
256      * @return the resourceadapter
257      */

258     public Resourceadapter getResourceadapter() {
259         return resourceadapter;
260     }
261
262     /**
263      * Set the resourceadapter
264      * @param resourceadapter resourceadapter
265      */

266     public void setResourceadapter(Resourceadapter resourceadapter) {
267         this.resourceadapter = resourceadapter;
268     }
269
270     /**
271      * Represents this element by it's XML description.
272      * @param indent use this indent for prefixing XML representation.
273      * @return the XML description of this object.
274      */

275     public String JavaDoc toXML(int indent) {
276         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
277         sb.append(indent(indent));
278         sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
279         sb.append("<connector");
280         sb.append(xmlAttribute(specVersion, "version"));
281         sb.append(">\n");
282
283         indent += 2;
284
285         // description
286
sb.append(descriptionList.toXML(indent));
287         // display-name
288
sb.append(xmlElement(displayName, "display-name", indent));
289         // icon
290
if (icon != null) {
291             sb.append(icon.toXML(indent));
292         }
293         // vendor-name
294
sb.append(xmlElement(vendorName, "vendor-name", indent));
295         // eis-type
296
sb.append(xmlElement(eisType, "eis-type", indent));
297         // version
298
sb.append(xmlElement(resourceadapterVersion, "resourceadapter-version", indent));
299         // license
300
if (license != null) {
301             sb.append(license.toXML(indent));
302         }
303         // resourceadapter
304
if (resourceadapter != null) {
305             sb.append(resourceadapter.toXML(indent));
306         }
307         indent -= 2;
308         sb.append(indent(indent));
309         sb.append("</connector>\n");
310
311         return sb.toString();
312     }
313 }
314
Popular Tags