KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openejb > alt > config > ejb11 > MethodParams


1 /*
2  * This class was automatically generated with
3  * <a HREF="http://www.castor.org">Castor 0.9.5.3</a>, using an XML
4  * Schema.
5  * $Id: MethodParams.java 1104 2004-03-31 00:44:02Z dblevins $
6  */

7
8 package org.openejb.alt.config.ejb11;
9
10   //---------------------------------/
11
//- Imported classes and packages -/
12
//---------------------------------/
13

14 import java.io.IOException JavaDoc;
15 import java.io.Reader JavaDoc;
16 import java.io.Serializable JavaDoc;
17 import java.io.Writer JavaDoc;
18 import java.util.Enumeration JavaDoc;
19 import java.util.Vector JavaDoc;
20 import org.exolab.castor.xml.MarshalException;
21 import org.exolab.castor.xml.Marshaller;
22 import org.exolab.castor.xml.Unmarshaller;
23 import org.exolab.castor.xml.ValidationException;
24 import org.xml.sax.ContentHandler JavaDoc;
25
26 /**
27  * Class MethodParams.
28  *
29  * @version $Revision: 1104 $ $Date: 2004-03-30 16:44:02 -0800 (Tue, 30 Mar 2004) $
30  */

31 public class MethodParams implements java.io.Serializable JavaDoc {
32
33
34       //--------------------------/
35
//- Class/Member Variables -/
36
//--------------------------/
37

38     /**
39      * Field _id
40      */

41     private java.lang.String JavaDoc _id;
42
43     /**
44      * Field _methodParamList
45      */

46     private java.util.Vector JavaDoc _methodParamList;
47
48
49       //----------------/
50
//- Constructors -/
51
//----------------/
52

53     public MethodParams() {
54         super();
55         _methodParamList = new Vector JavaDoc();
56     } //-- org.openejb.alt.config.ejb11.MethodParams()
57

58
59       //-----------/
60
//- Methods -/
61
//-----------/
62

63     /**
64      * Method addMethodParam
65      *
66      * @param vMethodParam
67      */

68     public void addMethodParam(java.lang.String JavaDoc vMethodParam)
69         throws java.lang.IndexOutOfBoundsException JavaDoc
70     {
71         _methodParamList.addElement(vMethodParam);
72     } //-- void addMethodParam(java.lang.String)
73

74     /**
75      * Method addMethodParam
76      *
77      * @param index
78      * @param vMethodParam
79      */

80     public void addMethodParam(int index, java.lang.String JavaDoc vMethodParam)
81         throws java.lang.IndexOutOfBoundsException JavaDoc
82     {
83         _methodParamList.insertElementAt(vMethodParam, index);
84     } //-- void addMethodParam(int, java.lang.String)
85

86     /**
87      * Method enumerateMethodParam
88      */

89     public java.util.Enumeration JavaDoc enumerateMethodParam()
90     {
91         return _methodParamList.elements();
92     } //-- java.util.Enumeration enumerateMethodParam()
93

94     /**
95      * Returns the value of field 'id'.
96      *
97      * @return the value of field 'id'.
98      */

99     public java.lang.String JavaDoc getId()
100     {
101         return this._id;
102     } //-- java.lang.String getId()
103

104     /**
105      * Method getMethodParam
106      *
107      * @param index
108      */

109     public java.lang.String JavaDoc getMethodParam(int index)
110         throws java.lang.IndexOutOfBoundsException JavaDoc
111     {
112         //-- check bounds for index
113
if ((index < 0) || (index > _methodParamList.size())) {
114             throw new IndexOutOfBoundsException JavaDoc();
115         }
116         
117         return (String JavaDoc)_methodParamList.elementAt(index);
118     } //-- java.lang.String getMethodParam(int)
119

120     /**
121      * Method getMethodParam
122      */

123     public java.lang.String JavaDoc[] getMethodParam()
124     {
125         int size = _methodParamList.size();
126         java.lang.String JavaDoc[] mArray = new java.lang.String JavaDoc[size];
127         for (int index = 0; index < size; index++) {
128             mArray[index] = (String JavaDoc)_methodParamList.elementAt(index);
129         }
130         return mArray;
131     } //-- java.lang.String[] getMethodParam()
132

133     /**
134      * Method getMethodParamCount
135      */

136     public int getMethodParamCount()
137     {
138         return _methodParamList.size();
139     } //-- int getMethodParamCount()
140

141     /**
142      * Method isValid
143      */

144     public boolean isValid()
145     {
146         try {
147             validate();
148         }
149         catch (org.exolab.castor.xml.ValidationException vex) {
150             return false;
151         }
152         return true;
153     } //-- boolean isValid()
154

155     /**
156      * Method marshal
157      *
158      * @param out
159      */

160     public void marshal(java.io.Writer JavaDoc out)
161         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
162     {
163         
164         Marshaller.marshal(this, out);
165     } //-- void marshal(java.io.Writer)
166

167     /**
168      * Method marshal
169      *
170      * @param handler
171      */

172     public void marshal(org.xml.sax.ContentHandler JavaDoc handler)
173         throws java.io.IOException JavaDoc, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
174     {
175         
176         Marshaller.marshal(this, handler);
177     } //-- void marshal(org.xml.sax.ContentHandler)
178

179     /**
180      * Method removeAllMethodParam
181      */

182     public void removeAllMethodParam()
183     {
184         _methodParamList.removeAllElements();
185     } //-- void removeAllMethodParam()
186

187     /**
188      * Method removeMethodParam
189      *
190      * @param index
191      */

192     public java.lang.String JavaDoc removeMethodParam(int index)
193     {
194         java.lang.Object JavaDoc obj = _methodParamList.elementAt(index);
195         _methodParamList.removeElementAt(index);
196         return (String JavaDoc)obj;
197     } //-- java.lang.String removeMethodParam(int)
198

199     /**
200      * Sets the value of field 'id'.
201      *
202      * @param id the value of field 'id'.
203      */

204     public void setId(java.lang.String JavaDoc id)
205     {
206         this._id = id;
207     } //-- void setId(java.lang.String)
208

209     /**
210      * Method setMethodParam
211      *
212      * @param index
213      * @param vMethodParam
214      */

215     public void setMethodParam(int index, java.lang.String JavaDoc vMethodParam)
216         throws java.lang.IndexOutOfBoundsException JavaDoc
217     {
218         //-- check bounds for index
219
if ((index < 0) || (index > _methodParamList.size())) {
220             throw new IndexOutOfBoundsException JavaDoc();
221         }
222         _methodParamList.setElementAt(vMethodParam, index);
223     } //-- void setMethodParam(int, java.lang.String)
224

225     /**
226      * Method setMethodParam
227      *
228      * @param methodParamArray
229      */

230     public void setMethodParam(java.lang.String JavaDoc[] methodParamArray)
231     {
232         //-- copy array
233
_methodParamList.removeAllElements();
234         for (int i = 0; i < methodParamArray.length; i++) {
235             _methodParamList.addElement(methodParamArray[i]);
236         }
237     } //-- void setMethodParam(java.lang.String)
238

239     /**
240      * Method unmarshal
241      *
242      * @param reader
243      */

244     public static java.lang.Object JavaDoc unmarshal(java.io.Reader JavaDoc reader)
245         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
246     {
247         return (org.openejb.alt.config.ejb11.MethodParams) Unmarshaller.unmarshal(org.openejb.alt.config.ejb11.MethodParams.class, reader);
248     } //-- java.lang.Object unmarshal(java.io.Reader)
249

250     /**
251      * Method validate
252      */

253     public void validate()
254         throws org.exolab.castor.xml.ValidationException
255     {
256         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
257         validator.validate(this);
258     } //-- void validate()
259

260 }
261
Popular Tags