KickJava   Java API By Example, From Geeks To Geeks.

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


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: Webservices.java,v 1.2 2004/05/06 08:53:55 sauthieg Exp $
25  * --------------------------------------------------------------------------
26  */

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

40
41 public class Webservices extends AbsDescriptionElement
42     implements TopLevelElement, DescriptionGroupXml {
43
44     /**
45      * webservice-description
46      */

47     private JLinkedList webserviceDescriptionList = null;
48
49
50     /**
51      * Constructor
52      */

53     public Webservices() {
54         super();
55         webserviceDescriptionList = new JLinkedList("webservice-description");
56     }
57
58     /**
59      * Gets the webservice-description
60      * @return the webservice-description
61      */

62     public JLinkedList getWebserviceDescriptionList() {
63         return webserviceDescriptionList;
64     }
65
66     /**
67      * Set the webservice-description
68      * @param webserviceDescriptionList webserviceDescription
69      */

70     public void setWebserviceDescriptionList(JLinkedList webserviceDescriptionList) {
71         this.webserviceDescriptionList = webserviceDescriptionList;
72     }
73
74     /**
75      * Add a new webservice-description element to this object
76      * @param webserviceDescription the webserviceDescriptionobject
77      */

78     public void addWebserviceDescription(WebserviceDescription webserviceDescription) {
79         webserviceDescriptionList.add(webserviceDescription);
80     }
81
82     /**
83      * Represents this element by it's XML description.
84      * @param indent use this indent for prexifing XML representation.
85      * @return the XML description of this object.
86      */

87     public String JavaDoc toXML(int indent) {
88         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
89         sb.append(indent(indent));
90         sb.append("<webservices>\n");
91         indent += 2;
92
93         // description
94
sb.append(xmlElement(getDescription(), "description", indent));
95         // display-name
96
sb.append(xmlElement(getDisplayName(), "display-name", indent));
97         // icon
98
sb.append(getIcon().toXML(indent));
99         // webservice-description
100
sb.append(webserviceDescriptionList.toXML(indent));
101
102         indent -= 2;
103         sb.append(indent(indent));
104         sb.append("</webservices>\n");
105
106         return sb.toString();
107     }
108 }
109
Popular Tags