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: Method.java 4716 2004-05-10 11:45:44Z sauthieg $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_ejb.deployment.xml;
027:
028: import org.objectweb.jonas_lib.deployment.xml.AbsElement;
029:
030: /**
031: * This class defines the implementation of the element method
032: *
033: * @author JOnAS team
034: */
035:
036: public class Method extends AbsElement {
037:
038: /**
039: * description
040: */
041: private String description = null;
042:
043: /**
044: * ejb-name
045: */
046: private String ejbName = null;
047:
048: /**
049: * method-intf
050: */
051: private String methodIntf = null;
052:
053: /**
054: * method-name
055: */
056: private String methodName = null;
057:
058: /**
059: * method-params
060: */
061: private MethodParams methodParams = null;
062:
063: /**
064: * Constructor
065: */
066: public Method() {
067: super ();
068: }
069:
070: /**
071: * Gets the description
072: * @return the description
073: */
074: public String getDescription() {
075: return description;
076: }
077:
078: /**
079: * Set the description
080: * @param description description
081: */
082: public void setDescription(String description) {
083: this .description = description;
084: }
085:
086: /**
087: * Gets the ejb-name
088: * @return the ejb-name
089: */
090: public String getEjbName() {
091: return ejbName;
092: }
093:
094: /**
095: * Set the ejb-name
096: * @param ejbName ejbName
097: */
098: public void setEjbName(String ejbName) {
099: this .ejbName = ejbName;
100: }
101:
102: /**
103: * Gets the method-intf
104: * @return the method-intf
105: */
106: public String getMethodIntf() {
107: return methodIntf;
108: }
109:
110: /**
111: * Set the method-intf
112: * @param methodIntf methodIntf
113: */
114: public void setMethodIntf(String methodIntf) {
115: this .methodIntf = methodIntf;
116: }
117:
118: /**
119: * Gets the method-name
120: * @return the method-name
121: */
122: public String getMethodName() {
123: return methodName;
124: }
125:
126: /**
127: * Set the method-name
128: * @param methodName methodName
129: */
130: public void setMethodName(String methodName) {
131: this .methodName = methodName;
132: }
133:
134: /**
135: * Gets the method-params
136: * @return the method-params
137: */
138: public MethodParams getMethodParams() {
139: return methodParams;
140: }
141:
142: /**
143: * Set the method-params
144: * @param methodParams methodParams
145: */
146: public void setMethodParams(MethodParams methodParams) {
147: this .methodParams = methodParams;
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("<method>\n");
159:
160: indent += 2;
161:
162: // description
163: sb.append(xmlElement(description, "description", indent));
164: // ejb-name
165: sb.append(xmlElement(ejbName, "ejb-name", indent));
166: // method-intf
167: sb.append(xmlElement(methodIntf, "method-intf", indent));
168: // method-name
169: sb.append(xmlElement(methodName, "method-name", indent));
170: // method-params
171: if (methodParams != null) {
172: sb.append(methodParams.toXML(indent));
173: }
174: indent -= 2;
175: sb.append(indent(indent));
176: sb.append("</method>\n");
177:
178: return sb.toString();
179: }
180: }
|