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: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or 1any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * Initial developer: Florent BENOIT
022: * --------------------------------------------------------------------------
023: * $Id: InitParam.java 4718 2004-05-10 12:06:09Z sauthieg $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.jonas_lib.deployment.xml;
026:
027: /**
028: * This class defines the implementation of the element init-param
029: * @author Florent Benoit
030: */
031: public class InitParam extends AbsElement {
032:
033: /**
034: * Name of this parameter
035: */
036: private String paramName = null;
037:
038: /**
039: * Value of this parameter
040: */
041: private String paramValue = null;
042:
043: /**
044: * Description of the ejb-ref
045: */
046: private String description = null;
047:
048: // Setters
049:
050: /**
051: * Sets the description
052: * @param description the description to use
053: */
054: public void setDescription(String description) {
055: this .description = description;
056: }
057:
058: /**
059: * Sets the name
060: * @param paramName the name to use
061: */
062: public void setParamName(String paramName) {
063: this .paramName = paramName;
064: }
065:
066: /**
067: * Sets the value
068: * @param paramValue the value
069: */
070: public void setParamValue(String paramValue) {
071: this .paramValue = paramValue;
072: }
073:
074: // Getters
075:
076: /**
077: * @return the name of the parameter
078: */
079: public String getParamName() {
080: return paramName;
081: }
082:
083: /**
084: * @return the value of the parameter
085: */
086: public String getParamValue() {
087: return paramValue;
088: }
089:
090: /**
091: * @return the description of the parameter
092: */
093: public String getDescription() {
094: return description;
095: }
096:
097: /**
098: * Represents this element by it's XML description.
099: * @param indent use this indent for prexifing XML representation.
100: * @return the XML description of this object.
101: */
102: public String toXML(int indent) {
103: StringBuffer sb = new StringBuffer();
104: sb.append(indent(indent));
105: sb.append("<init-param>\n");
106:
107: indent += 2;
108:
109: // name
110: sb.append(xmlElement(paramName, "param-name", indent));
111:
112: // value
113: sb.append(xmlElement(paramValue, "param-value", indent));
114:
115: // value
116: sb.append(xmlElement(description, "description", indent));
117:
118: indent -= 2;
119: sb.append(indent(indent));
120: sb.append("</init-param>\n");
121:
122: return sb.toString();
123: }
124:
125: }
|