KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > dd > JavaMethod


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /**
25  * This generated bean class JavaMethod matches the schema element 'java-method'.
26  * The root bean class is SunEjbJar
27  *
28  * Generated on Tue Aug 08 09:56:25 PDT 2006
29  * @Generated
30  */

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

41 public class JavaMethod extends org.netbeans.modules.schema2beans.BaseBean
42 {
43
44     static Vector comparators = new Vector();
45     private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(5, 0, 0);
46
47     static public final String JavaDoc METHOD_NAME = "MethodName"; // NOI18N
48
static public final String JavaDoc METHOD_PARAMS = "MethodParams"; // NOI18N
49

50     public JavaMethod() {
51         this(Common.USE_DEFAULT_VALUES);
52     }
53
54     public JavaMethod(int options)
55     {
56         super(comparators, runtimeVersion);
57         // Properties (see root bean comments for the bean graph)
58
initPropertyTables(2);
59         this.createProperty("method-name", // NOI18N
60
METHOD_NAME,
61             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
62             String JavaDoc.class);
63         this.createProperty("method-params", // NOI18N
64
METHOD_PARAMS,
65             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
66             MethodParams.class);
67         this.initialize(options);
68     }
69
70     // Setting the default values of the properties
71
void initialize(int options) {
72
73     }
74
75     // This attribute is mandatory
76
public void setMethodName(String JavaDoc value) {
77         this.setValue(METHOD_NAME, value);
78     }
79
80     //
81
public String JavaDoc getMethodName() {
82         return (String JavaDoc)this.getValue(METHOD_NAME);
83     }
84
85     // This attribute is optional
86
public void setMethodParams(MethodParams value) {
87         this.setValue(METHOD_PARAMS, value);
88     }
89
90     //
91
public MethodParams getMethodParams() {
92         return (MethodParams)this.getValue(METHOD_PARAMS);
93     }
94
95     /**
96      * Create a new bean using it's default constructor.
97      * This does not add it to any bean graph.
98      */

99     public MethodParams newMethodParams() {
100         return new MethodParams();
101     }
102
103     //
104
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
105         comparators.add(c);
106     }
107
108     //
109
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
110         comparators.remove(c);
111     }
112     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
113     }
114
115     // Dump the content of this bean returning it as a String
116
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
117         String JavaDoc s;
118         Object JavaDoc o;
119         org.netbeans.modules.schema2beans.BaseBean n;
120         str.append(indent);
121         str.append("MethodName"); // NOI18N
122
str.append(indent+"\t"); // NOI18N
123
str.append("<"); // NOI18N
124
o = this.getMethodName();
125         str.append((o==null?"null":o.toString().trim())); // NOI18N
126
str.append(">\n"); // NOI18N
127
this.dumpAttributes(METHOD_NAME, 0, str, indent);
128
129         str.append(indent);
130         str.append("MethodParams"); // NOI18N
131
n = (org.netbeans.modules.schema2beans.BaseBean) this.getMethodParams();
132         if (n != null)
133             n.dump(str, indent + "\t"); // NOI18N
134
else
135             str.append(indent+"\tnull"); // NOI18N
136
this.dumpAttributes(METHOD_PARAMS, 0, str, indent);
137
138     }
139     public String JavaDoc dumpBeanNode(){
140         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
141         str.append("JavaMethod\n"); // NOI18N
142
this.dump(str, "\n "); // NOI18N
143
return str.toString();
144     }}
145
146 // END_NOI18N
147

148
Popular Tags