KickJava   Java API By Example, From Geeks To Geeks.

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


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: JonasActivationspec.java,v 1.4 2004/07/19 16:31:59 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-activationspec
35  *
36  * @author Eric Hardesty
37  */

38
39 public class JonasActivationspec 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      * jndi-name
53      */

54     private String JavaDoc jndiName = null;
55
56     /**
57      * defaultAS
58      */

59     private String JavaDoc defaultAS = null;
60
61     /**
62      * Constructor
63      */

64     public JonasActivationspec() {
65         super();
66         descriptionList = new JLinkedList("description");
67     }
68
69     /**
70      * Gets the id
71      * @return the id
72      */

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

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

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

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

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

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

121     public void setJndiName(String JavaDoc jndiName) {
122         this.jndiName = jndiName;
123     }
124
125     /**
126      * Gets the defaultAS
127      * @return the defaultAS
128      */

129     public String JavaDoc getDefaultAS() {
130         return defaultAS;
131     }
132
133     /**
134      * Set the defaultAS
135      * @param defaultAS defaultAS
136      */

137     public void setDefaultAS(String JavaDoc defaultAS) {
138         this.defaultAS = defaultAS;
139     }
140
141     /**
142      * Represents this element by it's XML description.
143      * @param indent use this indent for prefixing XML representation.
144      * @return the XML description of this object.
145      */

146     public String JavaDoc toXML(int indent) {
147         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
148         sb.append(indent(indent));
149         sb.append("<jonas-activationspec>\n");
150
151         indent += 2;
152
153         // id
154
sb.append(xmlElement(id, "id", indent));
155         // description
156
sb.append(descriptionList.toXML(indent));
157         // jndiname
158
sb.append(xmlElement(jndiName, "jndi-name", indent));
159         // defaultAS
160
sb.append(xmlElement(defaultAS, "defaultAS", indent));
161
162         indent -= 2;
163         sb.append(indent(indent));
164         sb.append("</jonas-activationspec>\n");
165
166         return sb.toString();
167     }
168 }
169
Popular Tags