KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_lib > deployment > xml > EnvEntry


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  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or 1any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * Initial developer: Florent BENOIT
22  * --------------------------------------------------------------------------
23  * $Id: EnvEntry.java,v 1.2 2004/05/10 12:04:39 sauthieg Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.jonas_lib.deployment.xml;
28
29 /**
30  * This class defines the implementation of the element env-entry.
31  * @author Florent Benoit
32  */

33 public class EnvEntry extends AbsElement {
34
35     /**
36      * Description of the env-entry
37      */

38     private String JavaDoc description = null;
39
40     /**
41      * Name of the env-entry
42      */

43     private String JavaDoc envEntryName = null;
44
45     /**
46      * Value of the env-entry
47      */

48     private String JavaDoc envEntryValue = null;
49
50     /**
51      * Type of the env-entry
52      */

53     private String JavaDoc envEntryType = null;
54
55
56
57     // Setters
58

59     /**
60      * Sets the description
61      * @param description the description to use
62      */

63     public void setDescription(String JavaDoc description) {
64         this.description = description;
65     }
66
67     /**
68      * Sets the name
69      * @param envEntryName the name to use
70      */

71     public void setEnvEntryName(String JavaDoc envEntryName) {
72         this.envEntryName = envEntryName;
73     }
74
75     /**
76      * Sets the value
77      * @param envEntryValue the value to use
78      */

79     public void setEnvEntryValue(String JavaDoc envEntryValue) {
80         this.envEntryValue = envEntryValue;
81     }
82
83     /**
84      * Sets the type
85      * @param envEntryType the type to use
86      */

87     public void setEnvEntryType(String JavaDoc envEntryType) {
88         this.envEntryType = envEntryType;
89     }
90
91
92
93     // Getters
94

95     /**
96      * @return the description of the env-entry
97      */

98     public String JavaDoc getDescription() {
99         return description;
100     }
101
102
103     /**
104      * @return the name of the env-entry
105      */

106     public String JavaDoc getEnvEntryName() {
107         return envEntryName;
108     }
109
110
111     /**
112      * @return the value of the env-entry
113      */

114     public String JavaDoc getEnvEntryValue() {
115         return envEntryValue;
116     }
117
118
119     /**
120      * @return the type of the env-entry
121      */

122     public String JavaDoc getEnvEntryType() {
123         return envEntryType;
124     }
125
126
127     /**
128      * Represents this element by it's XML description.
129      * @param indent use this indent for prexifing XML representation.
130      * @return the XML description of this object.
131      */

132     public String JavaDoc toXML(int indent) {
133         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
134         sb.append(indent(indent));
135         sb.append("<env-entry>\n");
136
137         indent += 2;
138
139         // Description
140
sb.append(xmlElement(description, "description", indent));
141
142         // name
143
sb.append(xmlElement(envEntryName, "env-entry-name", indent));
144
145         // value
146
sb.append(xmlElement(envEntryValue, "env-entry-value", indent));
147
148         // type
149
sb.append(xmlElement(envEntryType, "env-entry-type", indent));
150
151         indent -= 2;
152         sb.append(indent(indent));
153         sb.append("</env-entry>\n");
154
155         return sb.toString();
156     }
157
158 }
159
Popular Tags