KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * This generated bean class QueryMethod matches the schema element query-method
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 QueryMethod extends com.sun.enterprise.tools.common.dd.SunBaseBean
17 {
18
19     static Vector comparators = new Vector();
20
21     static public final String JavaDoc METHOD_NAME = "MethodName"; // NOI18N
22
static public final String JavaDoc METHOD_PARAMS = "MethodParams"; // NOI18N
23

24     public QueryMethod() {
25         this(Common.USE_DEFAULT_VALUES);
26     }
27
28     public QueryMethod(int options)
29     {
30         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
31         // Properties (see root bean comments for the bean graph)
32
this.createProperty("method-name", // NOI18N
33
METHOD_NAME,
34             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
35             String JavaDoc.class);
36         this.createProperty("method-params", // NOI18N
37
METHOD_PARAMS,
38             Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
39             MethodParams.class);
40         this.initialize(options);
41     }
42
43     // Setting the default values of the properties
44
void initialize(int options)
45     {
46     
47     }
48
49     // This attribute is mandatory
50
public void setMethodName(String JavaDoc value) {
51         this.setValue(METHOD_NAME, value);
52     }
53
54     //
55
public String JavaDoc getMethodName() {
56         return (String JavaDoc)this.getValue(METHOD_NAME);
57     }
58
59     // This attribute is mandatory
60
public void setMethodParams(MethodParams value) {
61         this.setValue(METHOD_PARAMS, value);
62     }
63
64     //
65
public MethodParams getMethodParams() {
66         return (MethodParams)this.getValue(METHOD_PARAMS);
67     }
68
69     //
70
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
71         comparators.add(c);
72     }
73
74     //
75
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
76         comparators.remove(c);
77     }
78     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
79         boolean restrictionFailure = false;
80         // Validating property methodName
81
if (getMethodName() == null) {
82             throw new org.netbeans.modules.schema2beans.ValidateException("getMethodName() == null", "methodName", this); // NOI18N
83
}
84         // Validating property methodParams
85
if (getMethodParams() == null) {
86             throw new org.netbeans.modules.schema2beans.ValidateException("getMethodParams() == null", "methodParams", this); // NOI18N
87
}
88         getMethodParams().validate();
89     }
90
91     // Dump the content of this bean returning it as a String
92
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
93         String JavaDoc s;
94         Object JavaDoc o;
95         org.netbeans.modules.schema2beans.BaseBean n;
96         str.append(indent);
97         str.append("MethodName"); // NOI18N
98
str.append(indent+"\t"); // NOI18N
99
str.append("<"); // NOI18N
100
s = this.getMethodName();
101         str.append((s==null?"null":s.trim())); // NOI18N
102
str.append(">\n"); // NOI18N
103
this.dumpAttributes(METHOD_NAME, 0, str, indent);
104
105         str.append(indent);
106         str.append("MethodParams"); // NOI18N
107
n = (org.netbeans.modules.schema2beans.BaseBean) this.getMethodParams();
108         if (n != null)
109             n.dump(str, indent + "\t"); // NOI18N
110
else
111             str.append(indent+"\tnull"); // NOI18N
112
this.dumpAttributes(METHOD_PARAMS, 0, str, indent);
113
114     }
115     public String JavaDoc dumpBeanNode(){
116         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
117         str.append("QueryMethod\n"); // NOI18N
118
this.dump(str, "\n "); // NOI18N
119
return str.toString();
120     }}
121
122 // END_NOI18N
123

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

147
Popular Tags