KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > dd > ejb > EnterpriseBeans


1 /**
2  * This generated bean class EnterpriseBeans matches the schema element enterprise-beans
3  *
4  * Generated on Wed Mar 03 14:29:49 PST 2004
5  */

6
7 package com.sun.enterprise.tools.common.dd.ejb;
8
9 import org.w3c.dom.*;
10 import org.netbeans.modules.schema2beans.*;
11 import java.beans.*;
12 import java.util.*;
13 import com.sun.enterprise.tools.common.dd.MessageDestination;
14 import com.sun.enterprise.tools.common.dd.WebserviceDescription;
15
16 // BEGIN_NOI18N
17

18 public class EnterpriseBeans extends com.sun.enterprise.tools.common.dd.SunBaseBean
19 {
20
21     static Vector comparators = new Vector();
22
23     static public final String JavaDoc NAME = "Name"; // NOI18N
24
static public final String JavaDoc UNIQUE_ID = "UniqueId"; // NOI18N
25
static public final String JavaDoc EJB = "Ejb"; // NOI18N
26
static public final String JavaDoc PM_DESCRIPTORS = "PmDescriptors"; // NOI18N
27
static public final String JavaDoc CMP_RESOURCE = "CmpResource"; // NOI18N
28
static public final String JavaDoc MESSAGE_DESTINATION = "MessageDestination"; // NOI18N
29
static public final String JavaDoc WEBSERVICE_DESCRIPTION = "WebserviceDescription"; // NOI18N
30

31     public EnterpriseBeans() {
32         this(Common.USE_DEFAULT_VALUES);
33     }
34
35     public EnterpriseBeans(int options)
36     {
37         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
38         // Properties (see root bean comments for the bean graph)
39
this.createProperty("name", // NOI18N
40
NAME,
41             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
42             String JavaDoc.class);
43         this.createProperty("unique-id", // NOI18N
44
UNIQUE_ID,
45             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
46             String JavaDoc.class);
47         this.createProperty("ejb", // NOI18N
48
EJB,
49             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
50             Ejb.class);
51         this.createAttribute(EJB, "availability-enabled", "AvailabilityEnabled",
52                         AttrProp.CDATA | AttrProp.IMPLIED,
53                         null, null);
54         this.createProperty("pm-descriptors", // NOI18N
55
PM_DESCRIPTORS,
56             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
57             PmDescriptors.class);
58         this.createProperty("cmp-resource", // NOI18N
59
CMP_RESOURCE,
60             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
61             CmpResource.class);
62         this.createProperty("message-destination", // NOI18N
63
MESSAGE_DESTINATION,
64             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
65             MessageDestination.class);
66         this.createProperty("webservice-description", // NOI18N
67
WEBSERVICE_DESCRIPTION,
68             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
69             WebserviceDescription.class);
70         this.initialize(options);
71     }
72
73     // Setting the default values of the properties
74
void initialize(int options)
75     {
76         
77     }
78
79     // This attribute is optional
80
public void setName(String JavaDoc value) {
81         this.setValue(NAME, value);
82     }
83
84     //
85
public String JavaDoc getName() {
86         return (String JavaDoc)this.getValue(NAME);
87     }
88
89     // This attribute is optional
90
public void setUniqueId(String JavaDoc value) {
91         this.setValue(UNIQUE_ID, value);
92     }
93
94     //
95
public String JavaDoc getUniqueId() {
96         return (String JavaDoc)this.getValue(UNIQUE_ID);
97     }
98
99     // This attribute is an array, possibly empty
100
public void setEjb(int index, Ejb value) {
101         this.setValue(EJB, index, value);
102     }
103
104     //
105
public Ejb getEjb(int index) {
106         return (Ejb)this.getValue(EJB, index);
107     }
108
109     // This attribute is an array, possibly empty
110
public void setEjb(Ejb[] value) {
111         this.setValue(EJB, value);
112     }
113
114     //
115
public Ejb[] getEjb() {
116         return (Ejb[])this.getValues(EJB);
117     }
118
119     // Return the number of properties
120
public int sizeEjb() {
121         return this.size(EJB);
122     }
123
124     // Add a new element returning its index in the list
125
public int addEjb(Ejb value) {
126         return this.addValue(EJB, value);
127     }
128
129     //
130
// Remove an element using its reference
131
// Returns the index the element had in the list
132
//
133
public int removeEjb(Ejb value) {
134         return this.removeValue(EJB, value);
135     }
136
137     // This attribute is optional
138
public void setPmDescriptors(PmDescriptors value) {
139         this.setValue(PM_DESCRIPTORS, value);
140     }
141
142     //
143
public PmDescriptors getPmDescriptors() {
144         return (PmDescriptors)this.getValue(PM_DESCRIPTORS);
145     }
146
147     // This attribute is optional
148
public void setCmpResource(CmpResource value) {
149         this.setValue(CMP_RESOURCE, value);
150     }
151
152     //
153
public CmpResource getCmpResource() {
154         return (CmpResource)this.getValue(CMP_RESOURCE);
155     }
156
157     // This attribute is an array, possibly empty
158
public void setMessageDestination(int index, MessageDestination value) {
159         this.setValue(MESSAGE_DESTINATION, index, value);
160     }
161
162     //
163
public MessageDestination getMessageDestination(int index) {
164         return (MessageDestination)this.getValue(MESSAGE_DESTINATION, index);
165     }
166
167     // This attribute is an array, possibly empty
168
public void setMessageDestination(MessageDestination[] value) {
169         this.setValue(MESSAGE_DESTINATION, value);
170     }
171
172     //
173
public MessageDestination[] getMessageDestination() {
174         return (MessageDestination[])this.getValues(MESSAGE_DESTINATION);
175     }
176
177     // Return the number of properties
178
public int sizeMessageDestination() {
179         return this.size(MESSAGE_DESTINATION);
180     }
181
182     // Add a new element returning its index in the list
183
public int addMessageDestination(MessageDestination value) {
184         return this.addValue(MESSAGE_DESTINATION, value);
185     }
186
187     //
188
// Remove an element using its reference
189
// Returns the index the element had in the list
190
//
191
public int removeMessageDestination(MessageDestination value) {
192         return this.removeValue(MESSAGE_DESTINATION, value);
193     }
194
195     // This attribute is an array, possibly empty
196
public void setWebserviceDescription(int index, WebserviceDescription value) {
197         this.setValue(WEBSERVICE_DESCRIPTION, index, value);
198     }
199
200     //
201
public WebserviceDescription getWebserviceDescription(int index) {
202         return (WebserviceDescription)this.getValue(WEBSERVICE_DESCRIPTION, index);
203     }
204
205     // This attribute is an array, possibly empty
206
public void setWebserviceDescription(WebserviceDescription[] value) {
207         this.setValue(WEBSERVICE_DESCRIPTION, value);
208     }
209
210     //
211
public WebserviceDescription[] getWebserviceDescription() {
212         return (WebserviceDescription[])this.getValues(WEBSERVICE_DESCRIPTION);
213     }
214
215     // Return the number of properties
216
public int sizeWebserviceDescription() {
217         return this.size(WEBSERVICE_DESCRIPTION);
218     }
219
220     // Add a new element returning its index in the list
221
public int addWebserviceDescription(WebserviceDescription value) {
222         return this.addValue(WEBSERVICE_DESCRIPTION, value);
223     }
224
225     //
226
// Remove an element using its reference
227
// Returns the index the element had in the list
228
//
229
public int removeWebserviceDescription(WebserviceDescription value) {
230         return this.removeValue(WEBSERVICE_DESCRIPTION, value);
231     }
232
233     //
234
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
235         comparators.add(c);
236     }
237
238     //
239
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
240         comparators.remove(c);
241     }
242     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
243         boolean restrictionFailure = false;
244         // Validating property name
245
if (getName() != null) {
246         }
247         // Validating property uniqueId
248
if (getUniqueId() != null) {
249         }
250         // Validating property ejb
251
for (int _index = 0; _index < sizeEjb(); ++_index) {
252             Ejb element = getEjb(_index);
253             if (element != null) {
254                 element.validate();
255             }
256         }
257         // Validating property pmDescriptors
258
if (getPmDescriptors() != null) {
259             getPmDescriptors().validate();
260         }
261         // Validating property cmpResource
262
if (getCmpResource() != null) {
263             getCmpResource().validate();
264         }
265         // Validating property messageDestination
266
for (int _index = 0; _index < sizeMessageDestination(); ++_index) {
267             MessageDestination element = getMessageDestination(_index);
268             if (element != null) {
269                 element.validate();
270             }
271         }
272         // Validating property webserviceDescription
273
for (int _index = 0; _index < sizeWebserviceDescription();
274             ++_index) {
275             WebserviceDescription element = getWebserviceDescription(_index);
276             if (element != null) {
277                 element.validate();
278             }
279         }
280     }
281
282     // Dump the content of this bean returning it as a String
283
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
284         String JavaDoc s;
285         Object JavaDoc o;
286         org.netbeans.modules.schema2beans.BaseBean n;
287         str.append(indent);
288         str.append("Name"); // NOI18N
289
str.append(indent+"\t"); // NOI18N
290
str.append("<"); // NOI18N
291
s = this.getName();
292         str.append((s==null?"null":s.trim())); // NOI18N
293
str.append(">\n"); // NOI18N
294
this.dumpAttributes(NAME, 0, str, indent);
295
296         str.append(indent);
297         str.append("UniqueId"); // NOI18N
298
str.append(indent+"\t"); // NOI18N
299
str.append("<"); // NOI18N
300
s = this.getUniqueId();
301         str.append((s==null?"null":s.trim())); // NOI18N
302
str.append(">\n"); // NOI18N
303
this.dumpAttributes(UNIQUE_ID, 0, str, indent);
304
305         str.append(indent);
306         str.append("Ejb["+this.sizeEjb()+"]"); // NOI18N
307
for(int i=0; i<this.sizeEjb(); i++)
308         {
309             str.append(indent+"\t");
310             str.append("#"+i+":");
311             n = (org.netbeans.modules.schema2beans.BaseBean) this.getEjb(i);
312             if (n != null)
313                 n.dump(str, indent + "\t"); // NOI18N
314
else
315                 str.append(indent+"\tnull"); // NOI18N
316
this.dumpAttributes(EJB, i, str, indent);
317         }
318
319         str.append(indent);
320         str.append("PmDescriptors"); // NOI18N
321
n = (org.netbeans.modules.schema2beans.BaseBean) this.getPmDescriptors();
322         if (n != null)
323             n.dump(str, indent + "\t"); // NOI18N
324
else
325             str.append(indent+"\tnull"); // NOI18N
326
this.dumpAttributes(PM_DESCRIPTORS, 0, str, indent);
327
328         str.append(indent);
329         str.append("CmpResource"); // NOI18N
330
n = (org.netbeans.modules.schema2beans.BaseBean) this.getCmpResource();
331         if (n != null)
332             n.dump(str, indent + "\t"); // NOI18N
333
else
334             str.append(indent+"\tnull"); // NOI18N
335
this.dumpAttributes(CMP_RESOURCE, 0, str, indent);
336
337         str.append(indent);
338         str.append("MessageDestination["+this.sizeMessageDestination()+"]"); // NOI18N
339
for(int i=0; i<this.sizeMessageDestination(); i++)
340         {
341             str.append(indent+"\t");
342             str.append("#"+i+":");
343             n = (org.netbeans.modules.schema2beans.BaseBean) this.getMessageDestination(i);
344             if (n != null)
345                 n.dump(str, indent + "\t"); // NOI18N
346
else
347                 str.append(indent+"\tnull"); // NOI18N
348
this.dumpAttributes(MESSAGE_DESTINATION, i, str, indent);
349         }
350
351         str.append(indent);
352         str.append("WebserviceDescription["+this.sizeWebserviceDescription()+"]"); // NOI18N
353
for(int i=0; i<this.sizeWebserviceDescription(); i++)
354         {
355             str.append(indent+"\t");
356             str.append("#"+i+":");
357             n = (org.netbeans.modules.schema2beans.BaseBean) this.getWebserviceDescription(i);
358             if (n != null)
359                 n.dump(str, indent + "\t"); // NOI18N
360
else
361                 str.append(indent+"\tnull"); // NOI18N
362
this.dumpAttributes(WEBSERVICE_DESCRIPTION, i, str, indent);
363         }
364
365     }
366     public String JavaDoc dumpBeanNode(){
367         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
368         str.append("EnterpriseBeans\n"); // NOI18N
369
this.dump(str, "\n "); // NOI18N
370
return str.toString();
371     }}
372
373 // END_NOI18N
374

375
376 /*
377  * The contents of this file are subject to the terms
378  * of the Common Development and Distribution License
379  * (the License). You may not use this file except in
380  * compliance with the License.
381  *
382  * You can obtain a copy of the license at
383  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
384  * glassfish/bootstrap/legal/CDDLv1.0.txt.
385  * See the License for the specific language governing
386  * permissions and limitations under the License.
387  *
388  * When distributing Covered Code, include this CDDL
389  * Header Notice in each file and include the License file
390  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
391  * If applicable, add the following below the CDDL Header,
392  * with the fields enclosed by brackets [] replaced by
393  * you own identifying information:
394  * "Portions Copyrighted [year] [name of copyright owner]"
395  *
396  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
397  */

398
Popular Tags