KickJava   Java API By Example, From Geeks To Geeks.

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


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: ResourceEnvRef.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 resource-env-ref.
31  * @author Florent Benoit
32  */

33 public class ResourceEnvRef extends AbsElement {
34
35     /**
36      * Description of the resource-env-ref
37      */

38     private String JavaDoc description = null;
39
40     /**
41      * Name of this resource-env-ref
42      */

43     private String JavaDoc resourceEnvRefName = null;
44
45     /**
46      * Type of this resource-env-ref
47      */

48     private String JavaDoc resourceEnvRefType = null;
49
50
51     // Setters
52

53     /**
54      * Sets the description
55      * @param description the description to use
56      */

57     public void setDescription(String JavaDoc description) {
58         this.description = description;
59     }
60
61
62     /**
63      * Sets the name
64      * @param resourceEnvRefName the name to use
65      */

66     public void setResourceEnvRefName(String JavaDoc resourceEnvRefName) {
67         this.resourceEnvRefName = resourceEnvRefName;
68     }
69
70
71     /**
72      * Sets the type
73      * @param resourceEnvRefType the type to use
74      */

75     public void setResourceEnvRefType(String JavaDoc resourceEnvRefType) {
76         this.resourceEnvRefType = resourceEnvRefType;
77     }
78
79
80
81     // Getters
82

83     /**
84      * @return the description of the resource-env-ref
85      */

86     public String JavaDoc getDescription() {
87         return description;
88     }
89
90
91     /**
92      * @return the name of the resource-env-ref
93      */

94     public String JavaDoc getResourceEnvRefName() {
95         return resourceEnvRefName;
96     }
97
98
99     /**
100      * @return the type of the resource-env-ref
101      */

102     public String JavaDoc getResourceEnvRefType() {
103         return resourceEnvRefType;
104     }
105
106
107
108     /**
109      * Represents this element by it's XML description.
110      * @param indent use this indent for prexifing XML representation.
111      * @return the XML description of this object.
112      */

113     public String JavaDoc toXML(int indent) {
114         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
115         sb.append(indent(indent));
116         sb.append("<resource-env-ref>\n");
117
118         indent += 2;
119
120         // Description
121
sb.append(xmlElement(description, "description", indent));
122
123         // name
124
sb.append(xmlElement(resourceEnvRefName, "resource-env-ref-name", indent));
125
126         // type
127
sb.append(xmlElement(resourceEnvRefType, "resource-env-ref-type", indent));
128
129         indent -= 2;
130         sb.append(indent(indent));
131         sb.append("</resource-env-ref>\n");
132
133         return sb.toString();
134     }
135
136
137
138 }
139
Popular Tags