KickJava   Java API By Example, From Geeks To Geeks.

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


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 MethodParams matches the schema element 'method-params'.
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 MethodParams 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_PARAM = "MethodParam"; // NOI18N
48

49     public MethodParams() {
50         this(Common.USE_DEFAULT_VALUES);
51     }
52
53     public MethodParams(int options)
54     {
55         super(comparators, runtimeVersion);
56         // Properties (see root bean comments for the bean graph)
57
initPropertyTables(1);
58         this.createProperty("method-param", // NOI18N
59
METHOD_PARAM,
60             Common.TYPE_0_N | Common.TYPE_STRING | Common.TYPE_KEY,
61             String JavaDoc.class);
62         this.initialize(options);
63     }
64
65     // Setting the default values of the properties
66
void initialize(int options) {
67
68     }
69
70     // This attribute is an array, possibly empty
71
public void setMethodParam(int index, String JavaDoc value) {
72         this.setValue(METHOD_PARAM, index, value);
73     }
74
75     //
76
public String JavaDoc getMethodParam(int index) {
77         return (String JavaDoc)this.getValue(METHOD_PARAM, index);
78     }
79
80     // Return the number of properties
81
public int sizeMethodParam() {
82         return this.size(METHOD_PARAM);
83     }
84
85     // This attribute is an array, possibly empty
86
public void setMethodParam(String JavaDoc[] value) {
87         this.setValue(METHOD_PARAM, value);
88     }
89
90     //
91
public String JavaDoc[] getMethodParam() {
92         return (String JavaDoc[])this.getValues(METHOD_PARAM);
93     }
94
95     // Add a new element returning its index in the list
96
public int addMethodParam(String JavaDoc value) {
97         int positionOfNewItem = this.addValue(METHOD_PARAM, value);
98         return positionOfNewItem;
99     }
100
101     //
102
// Remove an element using its reference
103
// Returns the index the element had in the list
104
//
105
public int removeMethodParam(String JavaDoc value) {
106         return this.removeValue(METHOD_PARAM, value);
107     }
108
109     //
110
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
111         comparators.add(c);
112     }
113
114     //
115
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
116         comparators.remove(c);
117     }
118     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
119     }
120
121     // Dump the content of this bean returning it as a String
122
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
123         String JavaDoc s;
124         Object JavaDoc o;
125         org.netbeans.modules.schema2beans.BaseBean n;
126         str.append(indent);
127         str.append("MethodParam["+this.sizeMethodParam()+"]"); // NOI18N
128
for(int i=0; i<this.sizeMethodParam(); i++)
129         {
130             str.append(indent+"\t");
131             str.append("#"+i+":");
132             str.append(indent+"\t"); // NOI18N
133
str.append("<"); // NOI18N
134
o = this.getMethodParam(i);
135             str.append((o==null?"null":o.toString().trim())); // NOI18N
136
str.append(">\n"); // NOI18N
137
this.dumpAttributes(METHOD_PARAM, i, str, indent);
138         }
139
140     }
141     public String JavaDoc dumpBeanNode(){
142         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
143         str.append("MethodParams\n"); // NOI18N
144
this.dump(str, "\n "); // NOI18N
145
return str.toString();
146     }}
147
148 // END_NOI18N
149

150
Popular Tags