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: Florent BENOIT
023: * --------------------------------------------------------------------------
024: * $Id: ConfigProperty.java 4397 2004-03-18 06:28:09Z 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 config-property
033: *
034: * @author Florent Benoit
035: */
036:
037: public class ConfigProperty 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: * config-property-type
051: */
052: private String configPropertyType = null;
053:
054: /**
055: * config-property-value
056: */
057: private String configPropertyValue = null;
058:
059: /**
060: * Constructor
061: */
062: public ConfigProperty() {
063: super ();
064: descriptionList = new JLinkedList("description");
065: }
066:
067: /**
068: * Gets the description
069: * @return the description
070: */
071: public JLinkedList getDescriptionList() {
072: return descriptionList;
073: }
074:
075: /**
076: * Set the description
077: * @param descriptionList description
078: */
079: public void setDescriptionList(JLinkedList descriptionList) {
080: this .descriptionList = descriptionList;
081: }
082:
083: /**
084: * Add a new description element to this object
085: * @param description the description String
086: */
087: public void addDescription(String description) {
088: descriptionList.add(description);
089: }
090:
091: /**
092: * Gets the config-property-name
093: * @return the config-property-name
094: */
095: public String getConfigPropertyName() {
096: return configPropertyName;
097: }
098:
099: /**
100: * Set the config-property-name
101: * @param configPropertyName configPropertyName
102: */
103: public void setConfigPropertyName(String configPropertyName) {
104: this .configPropertyName = configPropertyName;
105: }
106:
107: /**
108: * Gets the config-property-type
109: * @return the config-property-type
110: */
111: public String getConfigPropertyType() {
112: return configPropertyType;
113: }
114:
115: /**
116: * Set the config-property-type
117: * @param configPropertyType configPropertyType
118: */
119: public void setConfigPropertyType(String configPropertyType) {
120: this .configPropertyType = configPropertyType;
121: }
122:
123: /**
124: * Gets the config-property-value
125: * @return the config-property-value
126: */
127: public String getConfigPropertyValue() {
128: return configPropertyValue;
129: }
130:
131: /**
132: * Set the config-property-value
133: * @param configPropertyValue configPropertyValue
134: */
135: public void setConfigPropertyValue(String configPropertyValue) {
136: this .configPropertyValue = configPropertyValue;
137: }
138:
139: /**
140: * Represents this element by it's XML description.
141: * @param indent use this indent for prefixing XML representation.
142: * @return the XML description of this object.
143: */
144: public String toXML(int indent) {
145: StringBuffer sb = new StringBuffer();
146: sb.append(indent(indent));
147: sb.append("<config-property>\n");
148:
149: indent += 2;
150:
151: // description
152: sb.append(descriptionList.toXML(indent));
153: // config-property-name
154: sb.append(xmlElement(configPropertyName,
155: "config-property-name", indent));
156: // config-property-type
157: sb.append(xmlElement(configPropertyType,
158: "config-property-type", indent));
159: // config-property-value
160: sb.append(xmlElement(configPropertyValue,
161: "config-property-value", indent));
162: indent -= 2;
163: sb.append(indent(indent));
164: sb.append("</config-property>\n");
165:
166: return sb.toString();
167: }
168: }
|