KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

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

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

48     private String JavaDoc resType = null;
49
50     /**
51      * Auth of this resource-ref
52      */

53     private String JavaDoc resAuth = null;
54
55     /**
56      * Sharing-scope of this resource-ref
57      */

58     private String JavaDoc resSharingScope = null;
59
60
61
62     // Setters
63

64     /**
65      * Sets the description
66      * @param description the description to use
67      */

68     public void setDescription(String JavaDoc description) {
69         this.description = description;
70     }
71
72
73     /**
74      * Sets the name
75      * @param resRefName the name to use
76      */

77     public void setResRefName(String JavaDoc resRefName) {
78         this.resRefName = resRefName;
79     }
80
81
82     /**
83      * Sets the type
84      * @param resType the type to use
85      */

86     public void setResType(String JavaDoc resType) {
87         this.resType = resType;
88     }
89
90
91     /**
92      * Sets the auth
93      * @param resAuth the auth to use
94      */

95     public void setResAuth(String JavaDoc resAuth) {
96         this.resAuth = resAuth;
97     }
98
99
100     /**
101      * Sets the sharing-scope
102      * @param resSharingScope the sharing-scope to use
103      */

104     public void setResSharingScope(String JavaDoc resSharingScope) {
105         this.resSharingScope = resSharingScope;
106     }
107
108
109
110     // Getters
111

112     /**
113      * @return the description of the resource-ref
114      */

115     public String JavaDoc getDescription() {
116         return description;
117     }
118
119
120     /**
121      * @return the name of the resource-ref
122      */

123     public String JavaDoc getResRefName() {
124         return resRefName;
125     }
126
127
128     /**
129      * @return the type of the resource-ref
130      */

131     public String JavaDoc getResType() {
132         return resType;
133     }
134
135
136     /**
137      * @return the auth of the resource-ref
138      */

139     public String JavaDoc getResAuth() {
140         return resAuth;
141     }
142
143
144     /**
145      * @return the sharing-scope of the resource-ref
146      */

147     public String JavaDoc getResSharingScope() {
148         return resSharingScope;
149     }
150
151
152     /**
153      * Represents this element by it's XML description.
154      * @param indent use this indent for prexifing XML representation.
155      * @return the XML description of this object.
156      */

157     public String JavaDoc toXML(int indent) {
158         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
159         sb.append(indent(indent));
160         sb.append("<resource-ref>\n");
161
162         indent += 2;
163
164         // Description
165
sb.append(xmlElement(description, "description", indent));
166
167         // name
168
sb.append(xmlElement(resRefName, "res-ref-name", indent));
169
170         // type
171
sb.append(xmlElement(resType, "res-type", indent));
172
173         // auth
174
sb.append(xmlElement(resAuth, "res-auth", indent));
175
176         // sharing-scope
177
sb.append(xmlElement(resSharingScope, "res-sharing-scope", indent));
178
179         indent -= 2;
180         sb.append(indent(indent));
181         sb.append("</resource-ref>\n");
182
183         return sb.toString();
184     }
185
186
187
188 }
189
Popular Tags