KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_rar > deployment > xml > ConfigProperty


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  *
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or 1any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  *
22  * Initial developer: Florent BENOIT
23  * --------------------------------------------------------------------------
24  * $Id: ConfigProperty.java,v 1.4 2004/03/18 06:28:09 ehardesty Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_rar.deployment.xml;
28
29 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
30 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
31
32 /**
33  * This class defines the implementation of the element config-property
34  *
35  * @author Florent Benoit
36  */

37
38 public class ConfigProperty extends AbsElement {
39
40     /**
41      * description
42      */

43     private JLinkedList descriptionList = null;
44
45     /**
46      * config-property-name
47      */

48     private String JavaDoc configPropertyName = null;
49
50     /**
51      * config-property-type
52      */

53     private String JavaDoc configPropertyType = null;
54
55     /**
56      * config-property-value
57      */

58     private String JavaDoc configPropertyValue = null;
59
60
61     /**
62      * Constructor
63      */

64     public ConfigProperty() {
65         super();
66         descriptionList = new JLinkedList("description");
67     }
68
69     /**
70      * Gets the description
71      * @return the description
72      */

73     public JLinkedList getDescriptionList() {
74         return descriptionList;
75     }
76
77     /**
78      * Set the description
79      * @param descriptionList description
80      */

81     public void setDescriptionList(JLinkedList descriptionList) {
82         this.descriptionList = descriptionList;
83     }
84
85     /**
86      * Add a new description element to this object
87      * @param description the description String
88      */

89     public void addDescription(String JavaDoc description) {
90         descriptionList.add(description);
91     }
92
93
94     /**
95      * Gets the config-property-name
96      * @return the config-property-name
97      */

98     public String JavaDoc getConfigPropertyName() {
99         return configPropertyName;
100     }
101
102     /**
103      * Set the config-property-name
104      * @param configPropertyName configPropertyName
105      */

106     public void setConfigPropertyName(String JavaDoc configPropertyName) {
107         this.configPropertyName = configPropertyName;
108     }
109
110     /**
111      * Gets the config-property-type
112      * @return the config-property-type
113      */

114     public String JavaDoc getConfigPropertyType() {
115         return configPropertyType;
116     }
117
118     /**
119      * Set the config-property-type
120      * @param configPropertyType configPropertyType
121      */

122     public void setConfigPropertyType(String JavaDoc configPropertyType) {
123         this.configPropertyType = configPropertyType;
124     }
125
126     /**
127      * Gets the config-property-value
128      * @return the config-property-value
129      */

130     public String JavaDoc getConfigPropertyValue() {
131         return configPropertyValue;
132     }
133
134     /**
135      * Set the config-property-value
136      * @param configPropertyValue configPropertyValue
137      */

138     public void setConfigPropertyValue(String JavaDoc configPropertyValue) {
139         this.configPropertyValue = configPropertyValue;
140     }
141
142     /**
143      * Represents this element by it's XML description.
144      * @param indent use this indent for prefixing XML representation.
145      * @return the XML description of this object.
146      */

147     public String JavaDoc toXML(int indent) {
148         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
149         sb.append(indent(indent));
150         sb.append("<config-property>\n");
151
152         indent += 2;
153
154         // description
155
sb.append(descriptionList.toXML(indent));
156         // config-property-name
157
sb.append(xmlElement(configPropertyName, "config-property-name", indent));
158         // config-property-type
159
sb.append(xmlElement(configPropertyType, "config-property-type", indent));
160         // config-property-value
161
sb.append(xmlElement(configPropertyValue, "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 }
169
Popular Tags