KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > dd > webservice > ResourceRefType


1 /**
2  * This generated bean class ResourceRefType matches the schema element resource-refType
3  *
4  * ===============================================================
5  *
6  *
7  *
8  * The resource-refType contains a declaration of a
9  * Deployment Component's reference to an external resource. It
10  * consists of an optional description, the resource manager
11  * connection factory reference name, the indication of the
12  * resource manager connection factory type expected by the
13  * Deployment Component code, the type of authentication
14  * (Application or Container), and an optional specification of
15  * the shareability of connections obtained from the resource
16  * (Shareable or Unshareable).
17  *
18  * Example:
19  *
20  * <resource-ref>
21  * <res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
22  * <res-type>javax.sql.DataSource</res-type>
23  * <res-auth>Container</res-auth>
24  * <res-sharing-scope>Shareable</res-sharing-scope>
25  * </resource-ref>
26  *
27  *
28  *
29  * ===============================================================
30  * Generated on Fri Apr 22 15:42:51 PDT 2005
31  */

32
33 package com.sun.enterprise.tools.common.dd.webservice;
34
35 import org.w3c.dom.*;
36 import org.netbeans.modules.schema2beans.*;
37 import java.beans.*;
38 import java.util.*;
39
40 // BEGIN_NOI18N
41

42 public class ResourceRefType extends org.netbeans.modules.schema2beans.BaseBean
43 {
44
45     static Vector comparators = new Vector();
46
47     static public final String JavaDoc DESCRIPTION = "Description"; // NOI18N
48
static public final String JavaDoc RES_REF_NAME = "ResRefName"; // NOI18N
49
static public final String JavaDoc RES_TYPE = "ResType"; // NOI18N
50
static public final String JavaDoc RES_AUTH = "ResAuth"; // NOI18N
51
static public final String JavaDoc RES_SHARING_SCOPE = "ResSharingScope"; // NOI18N
52

53     public ResourceRefType() {
54         this(Common.USE_DEFAULT_VALUES);
55     }
56
57     public ResourceRefType(int options)
58     {
59         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
60         // Properties (see root bean comments for the bean graph)
61
this.createProperty("description", // NOI18N
62
DESCRIPTION,
63             Common.TYPE_0_N | Common.TYPE_STRING | Common.TYPE_KEY,
64             java.lang.String JavaDoc.class);
65         this.createAttribute(DESCRIPTION, "id", "Id",
66                         AttrProp.CDATA | AttrProp.IMPLIED,
67                         null, null);
68         this.createAttribute(DESCRIPTION, "xml:lang", "XmlLang",
69                         AttrProp.CDATA | AttrProp.IMPLIED,
70                         null, null);
71         this.createProperty("res-ref-name", // NOI18N
72
RES_REF_NAME,
73             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
74             java.lang.String JavaDoc.class);
75         this.createProperty("res-type", // NOI18N
76
RES_TYPE,
77             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
78             java.lang.String JavaDoc.class);
79         this.createProperty("res-auth", // NOI18N
80
RES_AUTH,
81             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
82             java.lang.String JavaDoc.class);
83         this.createProperty("res-sharing-scope", // NOI18N
84
RES_SHARING_SCOPE,
85             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
86             java.lang.String JavaDoc.class);
87         this.initialize(options);
88     }
89
90     // Setting the default values of the properties
91
void initialize(int options)
92     {
93
94     }
95
96     // This attribute is an array, possibly empty
97
public void setDescription(int index, java.lang.String JavaDoc value) {
98         this.setValue(DESCRIPTION, index, value);
99     }
100
101     //
102
public java.lang.String JavaDoc getDescription(int index) {
103         return (java.lang.String JavaDoc)this.getValue(DESCRIPTION, index);
104     }
105
106     // This attribute is an array, possibly empty
107
public void setDescription(java.lang.String JavaDoc[] value) {
108         this.setValue(DESCRIPTION, value);
109     }
110
111     //
112
public java.lang.String JavaDoc[] getDescription() {
113         return (java.lang.String JavaDoc[])this.getValues(DESCRIPTION);
114     }
115
116     // Return the number of properties
117
public int sizeDescription() {
118         return this.size(DESCRIPTION);
119     }
120
121     // Add a new element returning its index in the list
122
public int addDescription(java.lang.String JavaDoc value) {
123         return this.addValue(DESCRIPTION, value);
124     }
125
126     //
127
// Remove an element using its reference
128
// Returns the index the element had in the list
129
//
130
public int removeDescription(java.lang.String JavaDoc value) {
131         return this.removeValue(DESCRIPTION, value);
132     }
133
134     // This attribute is mandatory
135
public void setResRefName(java.lang.String JavaDoc value) {
136         this.setValue(RES_REF_NAME, value);
137     }
138
139     //
140
public java.lang.String JavaDoc getResRefName() {
141         return (java.lang.String JavaDoc)this.getValue(RES_REF_NAME);
142     }
143
144     // This attribute is mandatory
145
public void setResType(java.lang.String JavaDoc value) {
146         this.setValue(RES_TYPE, value);
147     }
148
149     //
150
public java.lang.String JavaDoc getResType() {
151         return (java.lang.String JavaDoc)this.getValue(RES_TYPE);
152     }
153
154     // This attribute is mandatory
155
public void setResAuth(java.lang.String JavaDoc value) {
156         this.setValue(RES_AUTH, value);
157     }
158
159     //
160
public java.lang.String JavaDoc getResAuth() {
161         return (java.lang.String JavaDoc)this.getValue(RES_AUTH);
162     }
163
164     // This attribute is optional
165
public void setResSharingScope(java.lang.String JavaDoc value) {
166         this.setValue(RES_SHARING_SCOPE, value);
167     }
168
169     //
170
public java.lang.String JavaDoc getResSharingScope() {
171         return (java.lang.String JavaDoc)this.getValue(RES_SHARING_SCOPE);
172     }
173
174     //
175
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
176         comparators.add(c);
177     }
178
179     //
180
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
181         comparators.remove(c);
182     }
183     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
184     }
185
186     // Dump the content of this bean returning it as a String
187
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
188         String JavaDoc s;
189         Object JavaDoc o;
190         org.netbeans.modules.schema2beans.BaseBean n;
191         str.append(indent);
192         str.append("Description["+this.sizeDescription()+"]"); // NOI18N
193
for(int i=0; i<this.sizeDescription(); i++)
194         {
195             str.append(indent+"\t");
196             str.append("#"+i+":");
197             str.append(indent+"\t"); // NOI18N
198
str.append("<"); // NOI18N
199
s = this.getDescription(i);
200             str.append((s==null?"null":s.trim())); // NOI18N
201
str.append(">\n"); // NOI18N
202
this.dumpAttributes(DESCRIPTION, i, str, indent);
203         }
204
205         str.append(indent);
206         str.append("ResRefName"); // NOI18N
207
str.append(indent+"\t"); // NOI18N
208
str.append("<"); // NOI18N
209
s = this.getResRefName();
210         str.append((s==null?"null":s.trim())); // NOI18N
211
str.append(">\n"); // NOI18N
212
this.dumpAttributes(RES_REF_NAME, 0, str, indent);
213
214         str.append(indent);
215         str.append("ResType"); // NOI18N
216
str.append(indent+"\t"); // NOI18N
217
str.append("<"); // NOI18N
218
s = this.getResType();
219         str.append((s==null?"null":s.trim())); // NOI18N
220
str.append(">\n"); // NOI18N
221
this.dumpAttributes(RES_TYPE, 0, str, indent);
222
223         str.append(indent);
224         str.append("ResAuth"); // NOI18N
225
str.append(indent+"\t"); // NOI18N
226
str.append("<"); // NOI18N
227
s = this.getResAuth();
228         str.append((s==null?"null":s.trim())); // NOI18N
229
str.append(">\n"); // NOI18N
230
this.dumpAttributes(RES_AUTH, 0, str, indent);
231
232         str.append(indent);
233         str.append("ResSharingScope"); // NOI18N
234
str.append(indent+"\t"); // NOI18N
235
str.append("<"); // NOI18N
236
s = this.getResSharingScope();
237         str.append((s==null?"null":s.trim())); // NOI18N
238
str.append(">\n"); // NOI18N
239
this.dumpAttributes(RES_SHARING_SCOPE, 0, str, indent);
240
241     }
242     public String JavaDoc dumpBeanNode(){
243         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
244         str.append("ResourceRefType\n"); // NOI18N
245
this.dump(str, "\n "); // NOI18N
246
return str.toString();
247     }}
248
249 // END_NOI18N
250

251
252 /*
253  * The contents of this file are subject to the terms
254  * of the Common Development and Distribution License
255  * (the License). You may not use this file except in
256  * compliance with the License.
257  *
258  * You can obtain a copy of the license at
259  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
260  * glassfish/bootstrap/legal/CDDLv1.0.txt.
261  * See the License for the specific language governing
262  * permissions and limitations under the License.
263  *
264  * When distributing Covered Code, include this CDDL
265  * Header Notice in each file and include the License file
266  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
267  * If applicable, add the following below the CDDL Header,
268  * with the fields enclosed by brackets [] replaced by
269  * you own identifying information:
270  * "Portions Copyrighted [year] [name of copyright owner]"
271  *
272  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
273  */

274
Popular Tags