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: Eric Hardesty
023: * --------------------------------------------------------------------------
024: * $Id: RequiredConfigProperty.java 3673 2003-11-11 20:03:28Z ehardesty $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_rar.deployment.xml;
027:
028: import org.objectweb.jonas_lib.deployment.xml.AbsElement;
029: import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
030:
031: /**
032: * This class defines the implementation of the element required-config-property
033: *
034: * @author Florent Benoit
035: */
036:
037: public class RequiredConfigProperty extends AbsElement {
038:
039: /**
040: * description
041: */
042: private JLinkedList descriptionList = null;
043:
044: /**
045: * config-property-name
046: */
047: private String configPropertyName = null;
048:
049: /**
050: * Constructor
051: */
052: public RequiredConfigProperty() {
053: super ();
054: descriptionList = new JLinkedList("description");
055: }
056:
057: /**
058: * Gets the description
059: * @return the description
060: */
061: public JLinkedList getDescriptionList() {
062: return descriptionList;
063: }
064:
065: /**
066: * Set the description
067: * @param descriptionList description
068: */
069: public void setDescriptionList(JLinkedList descriptionList) {
070: this .descriptionList = descriptionList;
071: }
072:
073: /**
074: * Add a new description element to this object
075: * @param description the description String
076: */
077: public void addDescription(String description) {
078: descriptionList.add(description);
079: }
080:
081: /**
082: * Gets the config-property-name
083: * @return the config-property-name
084: */
085: public String getConfigPropertyName() {
086: return configPropertyName;
087: }
088:
089: /**
090: * Set the config-property-name
091: * @param configPropertyName configPropertyName
092: */
093: public void setConfigPropertyName(String configPropertyName) {
094: this .configPropertyName = configPropertyName;
095: }
096:
097: /**
098: * Represents this element by it's XML description.
099: * @param indent use this indent for prefixing 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("<required-config-property>\n");
106:
107: indent += 2;
108:
109: // description
110: sb.append(descriptionList.toXML(indent));
111: // config-property-name
112: sb.append(xmlElement(configPropertyName,
113: "config-property-name", indent));
114: indent -= 2;
115: sb.append(indent(indent));
116: sb.append("</required-config-property>\n");
117:
118: return sb.toString();
119: }
120: }
|