KickJava   Java API By Example, From Geeks To Geeks.

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


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: Eric Hardesty
23  * --------------------------------------------------------------------------
24  * $Id: JonasAdminobject.java,v 1.3 2004/03/18 06:28:09 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 jonas-adminobject
35  *
36  * @author Eric Hardesty
37  */

38
39 public class JonasAdminobject extends AbsElement implements TopLevelElement {
40
41     /**
42      * id
43      */

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

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

54     private String JavaDoc jndiName = null;
55
56     /**
57      * jonas-config-property
58      */

59     private JLinkedList jonasConfigPropertyList = null;
60
61
62     /**
63      * Constructor
64      */

65     public JonasAdminobject() {
66         super();
67         descriptionList = new JLinkedList("description");
68         jonasConfigPropertyList = new JLinkedList("jonas-config-property");
69     }
70
71     /**
72      * Gets the id
73      * @return the id
74      */

75     public String JavaDoc getId() {
76         return id;
77     }
78
79     /**
80      * Set the id
81      * @param id id
82      */

83     public void setId(String JavaDoc id) {
84         this.id = id;
85     }
86
87     /**
88      * Gets the description
89      * @return the description
90      */

91     public JLinkedList getDescriptionList() {
92         return descriptionList;
93     }
94
95     /**
96      * Set the description
97      * @param descriptionList description
98      */

99     public void setDescriptionList(JLinkedList descriptionList) {
100         this.descriptionList = descriptionList;
101     }
102
103     /**
104      * Add a new description element to this object
105      * @param description the description String
106      */

107     public void addDescription(String JavaDoc description) {
108         descriptionList.add(description);
109     }
110
111     /**
112      * Gets the jndiName
113      * @return the jndiname
114      */

115     public String JavaDoc getJndiName() {
116         return jndiName;
117     }
118
119     /**
120      * Set the jndiname
121      * @param jndiName jndiname
122      */

123     public void setJndiName(String JavaDoc jndiName) {
124         this.jndiName = jndiName;
125     }
126
127     /**
128      * Gets the jonas-config-property
129      * @return the jonas-config-property
130      */

131     public JLinkedList getJonasConfigPropertyList() {
132         return jonasConfigPropertyList;
133     }
134
135     /**
136      * Set the jonas-config-property
137      * @param jonasConfigPropertyList jonasConfigProperty
138      */

139     public void setJonasConfigPropertyList(JLinkedList jonasConfigPropertyList) {
140         this.jonasConfigPropertyList = jonasConfigPropertyList;
141     }
142
143     /**
144      * Add a new jonas-config-property element to this object
145      * @param jonasConfigProperty the jonasConfigPropertyobject
146      */

147     public void addJonasConfigProperty(JonasConfigProperty jonasConfigProperty) {
148         jonasConfigPropertyList.add(jonasConfigProperty);
149     }
150
151     /**
152      * Represents this element by it's XML description.
153      * @param indent use this indent for prefixing XML representation.
154      * @return the XML description of this object.
155      */

156     public String JavaDoc toXML(int indent) {
157         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
158         sb.append(indent(indent));
159         sb.append("<jonas-adminobject>\n");
160
161         indent += 2;
162
163         // id
164
sb.append(xmlElement(id, "id", indent));
165         // description
166
sb.append(descriptionList.toXML(indent));
167         // jndiname
168
sb.append(xmlElement(jndiName, "jndi-name", indent));
169         // jonas-config-property
170
if (jonasConfigPropertyList != null) {
171             sb.append(jonasConfigPropertyList.toXML(indent));
172         }
173         indent -= 2;
174         sb.append(indent(indent));
175         sb.append("</jonas-adminobject>\n");
176
177         return sb.toString();
178     }
179 }
180
Popular Tags