KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ws > deployment > xml > JonasWebservices


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: JOnAS team
23  * --------------------------------------------------------------------------
24  * $Id: JonasWebservices.java,v 1.4 2004/10/14 13:19:58 sauthieg Exp $
25  * --------------------------------------------------------------------------
26  */

27
28 package org.objectweb.jonas_ws.deployment.xml;
29
30 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
31 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
32 import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
33
34 /**
35  * This class defines the implementation of the element jonas-webservices
36  *
37  * @author JOnAS team
38  */

39
40 public class JonasWebservices extends AbsElement implements TopLevelElement {
41
42     /**
43      * Header (with right XSD version) for XML
44      */

45     private String JavaDoc header = null;
46
47     /**
48      * war
49      */

50     private String JavaDoc war = null;
51
52     /**
53      * context-root
54      */

55     private String JavaDoc contextRoot = null;
56
57     /**
58      * jonas-webservice-description
59      */

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

65     public JonasWebservices() {
66         super();
67         jwsDescList = new JLinkedList("jonas-webservice-description");
68     }
69
70     /**
71      * Gets the war
72      * @return the war
73      */

74     public String JavaDoc getWar() {
75         return war;
76     }
77
78     /**
79      * Set the war
80      * @param war war
81      */

82     public void setWar(String JavaDoc war) {
83         this.war = war;
84     }
85
86     /**
87      * @return Returns the contextRoot.
88      */

89     public String JavaDoc getContextRoot() {
90         return contextRoot;
91     }
92
93     /**
94      * @param contextRoot The contextRoot to set.
95      */

96     public void setContextRoot(String JavaDoc contextRoot) {
97         this.contextRoot = contextRoot;
98     }
99
100     /**
101      * Gets the jonas-webservice-description
102      * @return the jonas-webservice-description
103      */

104     public JLinkedList getJonasWebserviceDescriptionList() {
105         return jwsDescList;
106     }
107
108
109     /**
110      * Add a new jonas-webservice-description element to this object
111      * @param jwsd the jonas-webservice-description
112      */

113     public void addJonasWebserviceDescription(JonasWebserviceDescription jwsd) {
114         jwsDescList.add(jwsd);
115     }
116
117     /**
118      * Represents this element by it's XML description.
119      * @param indent use this indent for prexifing XML representation.
120      * @return the XML description of this object.
121      */

122     public String JavaDoc toXML(int indent) {
123         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
124         sb.append(indent(indent));
125         sb.append("<jonas-webservices>\n");
126
127         indent += 2;
128
129         // war
130
sb.append(xmlElement(war, "war", indent));
131         // context-root
132
sb.append(xmlElement(contextRoot, "context-root", indent));
133         // jonas-webservice-description
134
sb.append(jwsDescList.toXML(indent));
135
136         indent -= 2;
137         sb.append(indent(indent));
138         sb.append("</jonas-webservices>\n");
139
140         return sb.toString();
141     }
142     /**
143      * @return the header.
144      */

145     public String JavaDoc getHeader() {
146         return header;
147     }
148
149     /**
150      * @param header The header to set.
151      */

152     public void setHeader(String JavaDoc header) {
153         this.header = header;
154     }
155
156 }
157
Popular Tags