001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: *
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or 1any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
020: * USA
021: *
022: * Initial developer: JOnAS team
023: * --------------------------------------------------------------------------
024: * $Id: Webservices.java 4704 2004-05-06 08:53:55Z sauthieg $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_ws.deployment.xml;
027:
028: import org.objectweb.jonas_lib.deployment.xml.AbsDescriptionElement;
029: import org.objectweb.jonas_lib.deployment.xml.DescriptionGroupXml;
030: import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
031: import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
032:
033: /**
034: * This class defines the implementation of the element webservices
035: *
036: * @author JOnAS team
037: */
038:
039: public class Webservices extends AbsDescriptionElement implements
040: TopLevelElement, DescriptionGroupXml {
041:
042: /**
043: * webservice-description
044: */
045: private JLinkedList webserviceDescriptionList = null;
046:
047: /**
048: * Constructor
049: */
050: public Webservices() {
051: super ();
052: webserviceDescriptionList = new JLinkedList(
053: "webservice-description");
054: }
055:
056: /**
057: * Gets the webservice-description
058: * @return the webservice-description
059: */
060: public JLinkedList getWebserviceDescriptionList() {
061: return webserviceDescriptionList;
062: }
063:
064: /**
065: * Set the webservice-description
066: * @param webserviceDescriptionList webserviceDescription
067: */
068: public void setWebserviceDescriptionList(
069: JLinkedList webserviceDescriptionList) {
070: this .webserviceDescriptionList = webserviceDescriptionList;
071: }
072:
073: /**
074: * Add a new webservice-description element to this object
075: * @param webserviceDescription the webserviceDescriptionobject
076: */
077: public void addWebserviceDescription(
078: WebserviceDescription webserviceDescription) {
079: webserviceDescriptionList.add(webserviceDescription);
080: }
081:
082: /**
083: * Represents this element by it's XML description.
084: * @param indent use this indent for prexifing XML representation.
085: * @return the XML description of this object.
086: */
087: public String toXML(int indent) {
088: StringBuffer sb = new StringBuffer();
089: sb.append(indent(indent));
090: sb.append("<webservices>\n");
091: indent += 2;
092:
093: // description
094: sb.append(xmlElement(getDescription(), "description", indent));
095: // display-name
096: sb.append(xmlElement(getDisplayName(), "display-name", indent));
097: // icon
098: sb.append(getIcon().toXML(indent));
099: // 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: }
|