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: Module.java 7467 2005-10-04 12:53:14Z sauthieg $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_ear.deployment.xml;
027:
028: import org.objectweb.jonas_lib.deployment.xml.AbsElement;
029:
030: /**
031: * This class defines the implementation of the element module
032: *
033: * @author JOnAS team
034: */
035:
036: public class Module extends AbsElement {
037:
038: /**
039: * connector
040: */
041: private String connector = null;
042:
043: /**
044: * ejb
045: */
046: private String ejb = null;
047:
048: /**
049: * java
050: */
051: private String java = null;
052:
053: /**
054: * web
055: */
056: private Web web = null;
057:
058: /**
059: * alt-dd
060: */
061: private String altDd = null;
062:
063: /**
064: * Constructor
065: */
066: public Module() {
067: super ();
068: }
069:
070: /**
071: * Gets the connector
072: * @return the connector
073: */
074: public String getConnector() {
075: return connector;
076: }
077:
078: /**
079: * Set the connector
080: * @param connector connector
081: */
082: public void setConnector(String connector) {
083: this .connector = connector;
084: }
085:
086: /**
087: * Gets the ejb
088: * @return the ejb
089: */
090: public String getEjb() {
091: return ejb;
092: }
093:
094: /**
095: * Set the ejb
096: * @param ejb ejb
097: */
098: public void setEjb(String ejb) {
099: this .ejb = ejb;
100: }
101:
102: /**
103: * Gets the java
104: * @return the java
105: */
106: public String getJava() {
107: return java;
108: }
109:
110: /**
111: * Set the java
112: * @param java java
113: */
114: public void setJava(String java) {
115: this .java = java;
116: }
117:
118: /**
119: * Gets the web
120: * @return the web
121: */
122: public Web getWeb() {
123: return web;
124: }
125:
126: /**
127: * Set the web
128: * @param web web
129: */
130: public void setWeb(Web web) {
131: this .web = web;
132: }
133:
134: /**
135: * Gets the alt-dd
136: * @return the alt-dd
137: */
138: public String getAltDd() {
139: return altDd;
140: }
141:
142: /**
143: * Set the alt-dd
144: * @param altDd altDd
145: */
146: public void setAltDd(String altDd) {
147: this .altDd = altDd;
148: }
149:
150: /**
151: * Represents this element by it's XML description.
152: * @param indent use this indent for prexifing XML representation.
153: * @return the XML description of this object.
154: */
155: public String toXML(int indent) {
156: StringBuffer sb = new StringBuffer();
157: sb.append(indent(indent));
158: sb.append("<module>\n");
159:
160: indent += 2;
161:
162: // connector
163: if (connector != null) {
164: sb.append(xmlElement(connector, "connector", indent));
165: }
166: // ejb
167: if (ejb != null) {
168: sb.append(xmlElement(ejb, "ejb", indent));
169: }
170: // java
171: if (java != null) {
172: sb.append(xmlElement(java, "java", indent));
173: }
174: // web
175: if (web != null) {
176: sb.append(web.toXML(indent));
177: }
178: // alt-dd
179: if (altDd != null) {
180: sb.append(xmlElement(altDd, "alt-dd", indent));
181: }
182: indent -= 2;
183: sb.append(indent(indent));
184: sb.append("</module>\n");
185:
186: return sb.toString();
187: }
188: }
|