KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * This generated bean class PrefetchDisabled matches the schema element prefetch-disabled
3  *
4  * Generated on Thu Apr 08 14:40:31 PDT 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
14 // BEGIN_NOI18N
15

16 public class PrefetchDisabled extends com.sun.enterprise.tools.common.dd.SunBaseBean
17 {
18
19     static Vector comparators = new Vector();
20
21     static public final String JavaDoc QUERY_METHOD = "QueryMethod"; // NOI18N
22

23     public PrefetchDisabled() {
24         this(Common.USE_DEFAULT_VALUES);
25     }
26
27     public PrefetchDisabled(int options)
28     {
29         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
30         // Properties (see root bean comments for the bean graph)
31
this.createProperty("query-method", // NOI18N
32
QUERY_METHOD,
33             Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY,
34             QueryMethod.class);
35         this.initialize(options);
36     }
37
38     // Setting the default values of the properties
39
void initialize(int options)
40     {
41
42     }
43
44     // This attribute is an array containing at least one element
45
public void setQueryMethod(int index, QueryMethod value) {
46         this.setValue(QUERY_METHOD, index, value);
47     }
48
49     //
50
public QueryMethod getQueryMethod(int index) {
51         return (QueryMethod)this.getValue(QUERY_METHOD, index);
52     }
53
54     // This attribute is an array containing at least one element
55
public void setQueryMethod(QueryMethod[] value) {
56         this.setValue(QUERY_METHOD, value);
57     }
58
59     //
60
public QueryMethod[] getQueryMethod() {
61         return (QueryMethod[])this.getValues(QUERY_METHOD);
62     }
63
64     // Return the number of properties
65
public int sizeQueryMethod() {
66         return this.size(QUERY_METHOD);
67     }
68
69     // Add a new element returning its index in the list
70
public int addQueryMethod(com.sun.enterprise.tools.common.dd.ejb.QueryMethod value) {
71         return this.addValue(QUERY_METHOD, value);
72     }
73
74     //
75
// Remove an element using its reference
76
// Returns the index the element had in the list
77
//
78
public int removeQueryMethod(com.sun.enterprise.tools.common.dd.ejb.QueryMethod value) {
79         return this.removeValue(QUERY_METHOD, value);
80     }
81
82     //
83
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
84         comparators.add(c);
85     }
86
87     //
88
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
89         comparators.remove(c);
90     }
91     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
92         boolean restrictionFailure = false;
93         // Validating property queryMethod
94
if (sizeQueryMethod() == 0) {
95             throw new org.netbeans.modules.schema2beans.ValidateException("sizeQueryMethod() == 0", "queryMethod", this); // NOI18N
96
}
97         for (int _index = 0; _index < sizeQueryMethod(); ++_index) {
98             com.sun.enterprise.tools.common.dd.ejb.QueryMethod element = getQueryMethod(_index);
99             if (element != null) {
100                 element.validate();
101             }
102         }
103     }
104
105     // Dump the content of this bean returning it as a String
106
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
107         String JavaDoc s;
108         Object JavaDoc o;
109         org.netbeans.modules.schema2beans.BaseBean n;
110         str.append(indent);
111         str.append("QueryMethod["+this.sizeQueryMethod()+"]"); // NOI18N
112
for(int i=0; i<this.sizeQueryMethod(); i++)
113         {
114             str.append(indent+"\t");
115             str.append("#"+i+":");
116             n = (org.netbeans.modules.schema2beans.BaseBean) this.getQueryMethod(i);
117             if (n != null)
118                 n.dump(str, indent + "\t"); // NOI18N
119
else
120                 str.append(indent+"\tnull"); // NOI18N
121
this.dumpAttributes(QUERY_METHOD, i, str, indent);
122         }
123
124     }
125     public String JavaDoc dumpBeanNode(){
126         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
127         str.append("PrefetchDisabled\n"); // NOI18N
128
this.dump(str, "\n "); // NOI18N
129
return str.toString();
130     }}
131
132 // END_NOI18N
133

134
135 /*
136  * The contents of this file are subject to the terms
137  * of the Common Development and Distribution License
138  * (the License). You may not use this file except in
139  * compliance with the License.
140  *
141  * You can obtain a copy of the license at
142  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
143  * glassfish/bootstrap/legal/CDDLv1.0.txt.
144  * See the License for the specific language governing
145  * permissions and limitations under the License.
146  *
147  * When distributing Covered Code, include this CDDL
148  * Header Notice in each file and include the License file
149  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
150  * If applicable, add the following below the CDDL Header,
151  * with the fields enclosed by brackets [] replaced by
152  * you own identifying information:
153  * "Portions Copyrighted [year] [name of copyright owner]"
154  *
155  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
156  */

157
Popular Tags