KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * This generated bean class Method matches the schema element method
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
14 // BEGIN_NOI18N
15

16 public class Method extends com.sun.enterprise.tools.common.dd.SunBaseBean
17 {
18
19     static Vector comparators = new Vector();
20
21     static public final String JavaDoc DESCRIPTION = "Description"; // NOI18N
22
static public final String JavaDoc EJB_NAME = "EjbName"; // NOI18N
23
static public final String JavaDoc METHOD_NAME = "MethodName"; // NOI18N
24
static public final String JavaDoc METHOD_INTF = "MethodIntf"; // NOI18N
25
static public final String JavaDoc METHOD_PARAMS = "MethodParams"; // NOI18N
26

27     public Method() {
28         this(Common.USE_DEFAULT_VALUES);
29     }
30
31     public Method(int options)
32     {
33         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
34         // Properties (see root bean comments for the bean graph)
35
this.createProperty("description", // NOI18N
36
DESCRIPTION,
37             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
38             String JavaDoc.class);
39         this.createProperty("ejb-name", // NOI18N
40
EJB_NAME,
41             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
42             String JavaDoc.class);
43         this.createProperty("method-name", // NOI18N
44
METHOD_NAME,
45             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
46             String JavaDoc.class);
47         this.createProperty("method-intf", // NOI18N
48
METHOD_INTF,
49             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
50             String JavaDoc.class);
51         this.createProperty("method-params", // NOI18N
52
METHOD_PARAMS,
53             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
54             MethodParams.class);
55         this.initialize(options);
56     }
57
58     // Setting the default values of the properties
59
void initialize(int options)
60     {
61                 
62     }
63
64     // This attribute is optional
65
public void setDescription(String JavaDoc value) {
66         this.setValue(DESCRIPTION, value);
67     }
68
69     //
70
public String JavaDoc getDescription() {
71         return (String JavaDoc)this.getValue(DESCRIPTION);
72     }
73
74     // This attribute is optional
75
public void setEjbName(String JavaDoc value) {
76         this.setValue(EJB_NAME, value);
77     }
78
79     //
80
public String JavaDoc getEjbName() {
81         return (String JavaDoc)this.getValue(EJB_NAME);
82     }
83
84     // This attribute is mandatory
85
public void setMethodName(String JavaDoc value) {
86         this.setValue(METHOD_NAME, value);
87     }
88
89     //
90
public String JavaDoc getMethodName() {
91         return (String JavaDoc)this.getValue(METHOD_NAME);
92     }
93
94     // This attribute is optional
95
public void setMethodIntf(String JavaDoc value) {
96         this.setValue(METHOD_INTF, value);
97     }
98
99     //
100
public String JavaDoc getMethodIntf() {
101         return (String JavaDoc)this.getValue(METHOD_INTF);
102     }
103
104     // This attribute is optional
105
public void setMethodParams(MethodParams value) {
106         this.setValue(METHOD_PARAMS, value);
107     }
108
109     //
110
public MethodParams getMethodParams() {
111         return (MethodParams)this.getValue(METHOD_PARAMS);
112     }
113
114     //
115
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
116         comparators.add(c);
117     }
118
119     //
120
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
121         comparators.remove(c);
122     }
123     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
124         boolean restrictionFailure = false;
125         // Validating property description
126
if (getDescription() != null) {
127         }
128         // Validating property ejbName
129
if (getEjbName() != null) {
130         }
131         // Validating property methodName
132
if (getMethodName() == null) {
133             throw new org.netbeans.modules.schema2beans.ValidateException("getMethodName() == null", "methodName", this); // NOI18N
134
}
135         // Validating property methodIntf
136
if (getMethodIntf() != null) {
137         }
138         // Validating property methodParams
139
if (getMethodParams() != null) {
140             getMethodParams().validate();
141         }
142     }
143
144     // Dump the content of this bean returning it as a String
145
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
146         String JavaDoc s;
147         Object JavaDoc o;
148         org.netbeans.modules.schema2beans.BaseBean n;
149         str.append(indent);
150         str.append("Description"); // NOI18N
151
str.append(indent+"\t"); // NOI18N
152
str.append("<"); // NOI18N
153
s = this.getDescription();
154         str.append((s==null?"null":s.trim())); // NOI18N
155
str.append(">\n"); // NOI18N
156
this.dumpAttributes(DESCRIPTION, 0, str, indent);
157
158         str.append(indent);
159         str.append("EjbName"); // NOI18N
160
str.append(indent+"\t"); // NOI18N
161
str.append("<"); // NOI18N
162
s = this.getEjbName();
163         str.append((s==null?"null":s.trim())); // NOI18N
164
str.append(">\n"); // NOI18N
165
this.dumpAttributes(EJB_NAME, 0, str, indent);
166
167         str.append(indent);
168         str.append("MethodName"); // NOI18N
169
str.append(indent+"\t"); // NOI18N
170
str.append("<"); // NOI18N
171
s = this.getMethodName();
172         str.append((s==null?"null":s.trim())); // NOI18N
173
str.append(">\n"); // NOI18N
174
this.dumpAttributes(METHOD_NAME, 0, str, indent);
175
176         str.append(indent);
177         str.append("MethodIntf"); // NOI18N
178
str.append(indent+"\t"); // NOI18N
179
str.append("<"); // NOI18N
180
s = this.getMethodIntf();
181         str.append((s==null?"null":s.trim())); // NOI18N
182
str.append(">\n"); // NOI18N
183
this.dumpAttributes(METHOD_INTF, 0, str, indent);
184
185         str.append(indent);
186         str.append("MethodParams"); // NOI18N
187
n = (org.netbeans.modules.schema2beans.BaseBean) this.getMethodParams();
188         if (n != null)
189             n.dump(str, indent + "\t"); // NOI18N
190
else
191             str.append(indent+"\tnull"); // NOI18N
192
this.dumpAttributes(METHOD_PARAMS, 0, str, indent);
193
194     }
195     public String JavaDoc dumpBeanNode(){
196         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
197         str.append("Method\n"); // NOI18N
198
this.dump(str, "\n "); // NOI18N
199
return str.toString();
200     }}
201
202 // END_NOI18N
203

204
205 /*
206  * The contents of this file are subject to the terms
207  * of the Common Development and Distribution License
208  * (the License). You may not use this file except in
209  * compliance with the License.
210  *
211  * You can obtain a copy of the license at
212  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
213  * glassfish/bootstrap/legal/CDDLv1.0.txt.
214  * See the License for the specific language governing
215  * permissions and limitations under the License.
216  *
217  * When distributing Covered Code, include this CDDL
218  * Header Notice in each file and include the License file
219  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
220  * If applicable, add the following below the CDDL Header,
221  * with the fields enclosed by brackets [] replaced by
222  * you own identifying information:
223  * "Portions Copyrighted [year] [name of copyright owner]"
224  *
225  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
226  */

227
Popular Tags