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: JavaWsdlMapping.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.AbsElement;
029: import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
030: import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
031:
032: /**
033: * This class defines the implementation of the element java-wsdl-mapping
034: *
035: * @author JOnAS team
036: */
037:
038: public class JavaWsdlMapping extends AbsElement implements
039: TopLevelElement {
040:
041: /**
042: * package-mapping
043: */
044: private JLinkedList packageMappingList = null;
045:
046: /**
047: * java-xml-type-mapping
048: */
049: private JLinkedList javaXmlTypeMappingList = null;
050:
051: /**
052: * Constructor
053: */
054: public JavaWsdlMapping() {
055: super ();
056: packageMappingList = new JLinkedList("package-mapping");
057: javaXmlTypeMappingList = new JLinkedList(
058: "java-xml-type-mapping");
059: }
060:
061: /**
062: * Gets the package-mapping
063: * @return the package-mapping
064: */
065: public JLinkedList getPackageMappingList() {
066: return packageMappingList;
067: }
068:
069: /**
070: * Set the package-mapping
071: * @param packageMappingList packageMapping
072: */
073: public void setPackageMappingList(JLinkedList packageMappingList) {
074: this .packageMappingList = packageMappingList;
075: }
076:
077: /**
078: * Add a new package-mapping element to this object
079: * @param packageMapping the packageMappingobject
080: */
081: public void addPackageMapping(PackageMapping packageMapping) {
082: packageMappingList.add(packageMapping);
083: }
084:
085: /**
086: * Gets the java-xml-type-mapping
087: * @return the java-xml-type-mapping
088: */
089: public JLinkedList getJavaXmlTypeMappingList() {
090: return javaXmlTypeMappingList;
091: }
092:
093: /**
094: * Set the java-xml-type-mapping
095: * @param javaXmlTypeMappingList javaXmlTypeMapping
096: */
097: public void setJavaXmlTypeMappingList(
098: JLinkedList javaXmlTypeMappingList) {
099: this .javaXmlTypeMappingList = javaXmlTypeMappingList;
100: }
101:
102: /**
103: * Add a new java-xml-type-mapping element to this object
104: * @param javaXmlTypeMapping the javaXmlTypeMappingobject
105: */
106: public void addJavaXmlTypeMapping(
107: JavaXmlTypeMapping javaXmlTypeMapping) {
108: javaXmlTypeMappingList.add(javaXmlTypeMapping);
109: }
110:
111: /**
112: * Represents this element by it's XML description.
113: * @param indent use this indent for prexifing XML representation.
114: * @return the XML description of this object.
115: */
116: public String toXML(int indent) {
117: StringBuffer sb = new StringBuffer();
118: sb.append(indent(indent));
119: sb.append("<java-wsdl-mapping>\n");
120: indent += 2;
121:
122: // package-mapping
123: sb.append(packageMappingList.toXML(indent));
124: // java-xml-type-mapping
125: sb.append(javaXmlTypeMappingList.toXML(indent));
126:
127: indent -= 2;
128: sb.append(indent(indent));
129: sb.append("</java-wsdl-mapping>\n");
130:
131: return sb.toString();
132: }
133: }
|