KickJava   Java API By Example, From Geeks To Geeks.

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


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

27 package org.objectweb.jonas_ws.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 java-wsdl-mapping
35  *
36  * @author JOnAS team
37  */

38
39 public class JavaWsdlMapping extends AbsElement implements TopLevelElement {
40
41     /**
42      * package-mapping
43      */

44     private JLinkedList packageMappingList = null;
45
46     /**
47      * java-xml-type-mapping
48      */

49     private JLinkedList javaXmlTypeMappingList = null;
50
51     /**
52      * Constructor
53      */

54     public JavaWsdlMapping() {
55         super();
56         packageMappingList = new JLinkedList("package-mapping");
57         javaXmlTypeMappingList = new JLinkedList("java-xml-type-mapping");
58     }
59
60     /**
61      * Gets the package-mapping
62      * @return the package-mapping
63      */

64     public JLinkedList getPackageMappingList() {
65         return packageMappingList;
66     }
67
68     /**
69      * Set the package-mapping
70      * @param packageMappingList packageMapping
71      */

72     public void setPackageMappingList(JLinkedList packageMappingList) {
73         this.packageMappingList = packageMappingList;
74     }
75
76     /**
77      * Add a new package-mapping element to this object
78      * @param packageMapping the packageMappingobject
79      */

80     public void addPackageMapping(PackageMapping packageMapping) {
81         packageMappingList.add(packageMapping);
82     }
83
84     /**
85      * Gets the java-xml-type-mapping
86      * @return the java-xml-type-mapping
87      */

88     public JLinkedList getJavaXmlTypeMappingList() {
89         return javaXmlTypeMappingList;
90     }
91
92     /**
93      * Set the java-xml-type-mapping
94      * @param javaXmlTypeMappingList javaXmlTypeMapping
95      */

96     public void setJavaXmlTypeMappingList(JLinkedList javaXmlTypeMappingList) {
97         this.javaXmlTypeMappingList = javaXmlTypeMappingList;
98     }
99
100     /**
101      * Add a new java-xml-type-mapping element to this object
102      * @param javaXmlTypeMapping the javaXmlTypeMappingobject
103      */

104     public void addJavaXmlTypeMapping(JavaXmlTypeMapping javaXmlTypeMapping) {
105         javaXmlTypeMappingList.add(javaXmlTypeMapping);
106     }
107
108     /**
109      * Represents this element by it's XML description.
110      * @param indent use this indent for prexifing XML representation.
111      * @return the XML description of this object.
112      */

113     public String JavaDoc toXML(int indent) {
114         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
115         sb.append(indent(indent));
116         sb.append("<java-wsdl-mapping>\n");
117         indent += 2;
118
119         // package-mapping
120
sb.append(packageMappingList.toXML(indent));
121         // java-xml-type-mapping
122
sb.append(javaXmlTypeMappingList.toXML(indent));
123
124         indent -= 2;
125         sb.append(indent(indent));
126         sb.append("</java-wsdl-mapping>\n");
127
128         return sb.toString();
129     }
130 }
131
Popular Tags