KickJava   Java API By Example, From Geeks To Geeks.

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


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: MethodPermission.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 MethodPermission.
28  *
29  * @version $Revision: 1104 $ $Date: 2004-03-30 16:44:02 -0800 (Tue, 30 Mar 2004) $
30  */

31 public class MethodPermission 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 _description
45      */

46     private java.lang.String JavaDoc _description;
47
48     /**
49      * Field _roleNameList
50      */

51     private java.util.Vector JavaDoc _roleNameList;
52
53     /**
54      * Field _methodList
55      */

56     private java.util.Vector JavaDoc _methodList;
57
58
59       //----------------/
60
//- Constructors -/
61
//----------------/
62

63     public MethodPermission() {
64         super();
65         _roleNameList = new Vector JavaDoc();
66         _methodList = new Vector JavaDoc();
67     } //-- org.openejb.alt.config.ejb11.MethodPermission()
68

69
70       //-----------/
71
//- Methods -/
72
//-----------/
73

74     /**
75      * Method addMethod
76      *
77      * @param vMethod
78      */

79     public void addMethod(org.openejb.alt.config.ejb11.Method vMethod)
80         throws java.lang.IndexOutOfBoundsException JavaDoc
81     {
82         _methodList.addElement(vMethod);
83     } //-- void addMethod(org.openejb.alt.config.ejb11.Method)
84

85     /**
86      * Method addMethod
87      *
88      * @param index
89      * @param vMethod
90      */

91     public void addMethod(int index, org.openejb.alt.config.ejb11.Method vMethod)
92         throws java.lang.IndexOutOfBoundsException JavaDoc
93     {
94         _methodList.insertElementAt(vMethod, index);
95     } //-- void addMethod(int, org.openejb.alt.config.ejb11.Method)
96

97     /**
98      * Method addRoleName
99      *
100      * @param vRoleName
101      */

102     public void addRoleName(java.lang.String JavaDoc vRoleName)
103         throws java.lang.IndexOutOfBoundsException JavaDoc
104     {
105         _roleNameList.addElement(vRoleName);
106     } //-- void addRoleName(java.lang.String)
107

108     /**
109      * Method addRoleName
110      *
111      * @param index
112      * @param vRoleName
113      */

114     public void addRoleName(int index, java.lang.String JavaDoc vRoleName)
115         throws java.lang.IndexOutOfBoundsException JavaDoc
116     {
117         _roleNameList.insertElementAt(vRoleName, index);
118     } //-- void addRoleName(int, java.lang.String)
119

120     /**
121      * Method enumerateMethod
122      */

123     public java.util.Enumeration JavaDoc enumerateMethod()
124     {
125         return _methodList.elements();
126     } //-- java.util.Enumeration enumerateMethod()
127

128     /**
129      * Method enumerateRoleName
130      */

131     public java.util.Enumeration JavaDoc enumerateRoleName()
132     {
133         return _roleNameList.elements();
134     } //-- java.util.Enumeration enumerateRoleName()
135

136     /**
137      * Returns the value of field 'description'.
138      *
139      * @return the value of field 'description'.
140      */

141     public java.lang.String JavaDoc getDescription()
142     {
143         return this._description;
144     } //-- java.lang.String getDescription()
145

146     /**
147      * Returns the value of field 'id'.
148      *
149      * @return the value of field 'id'.
150      */

151     public java.lang.String JavaDoc getId()
152     {
153         return this._id;
154     } //-- java.lang.String getId()
155

156     /**
157      * Method getMethod
158      *
159      * @param index
160      */

161     public org.openejb.alt.config.ejb11.Method getMethod(int index)
162         throws java.lang.IndexOutOfBoundsException JavaDoc
163     {
164         //-- check bounds for index
165
if ((index < 0) || (index > _methodList.size())) {
166             throw new IndexOutOfBoundsException JavaDoc();
167         }
168         
169         return (org.openejb.alt.config.ejb11.Method) _methodList.elementAt(index);
170     } //-- org.openejb.alt.config.ejb11.Method getMethod(int)
171

172     /**
173      * Method getMethod
174      */

175     public org.openejb.alt.config.ejb11.Method[] getMethod()
176     {
177         int size = _methodList.size();
178         org.openejb.alt.config.ejb11.Method[] mArray = new org.openejb.alt.config.ejb11.Method[size];
179         for (int index = 0; index < size; index++) {
180             mArray[index] = (org.openejb.alt.config.ejb11.Method) _methodList.elementAt(index);
181         }
182         return mArray;
183     } //-- org.openejb.alt.config.ejb11.Method[] getMethod()
184

185     /**
186      * Method getMethodCount
187      */

188     public int getMethodCount()
189     {
190         return _methodList.size();
191     } //-- int getMethodCount()
192

193     /**
194      * Method getRoleName
195      *
196      * @param index
197      */

198     public java.lang.String JavaDoc getRoleName(int index)
199         throws java.lang.IndexOutOfBoundsException JavaDoc
200     {
201         //-- check bounds for index
202
if ((index < 0) || (index > _roleNameList.size())) {
203             throw new IndexOutOfBoundsException JavaDoc();
204         }
205         
206         return (String JavaDoc)_roleNameList.elementAt(index);
207     } //-- java.lang.String getRoleName(int)
208

209     /**
210      * Method getRoleName
211      */

212     public java.lang.String JavaDoc[] getRoleName()
213     {
214         int size = _roleNameList.size();
215         java.lang.String JavaDoc[] mArray = new java.lang.String JavaDoc[size];
216         for (int index = 0; index < size; index++) {
217             mArray[index] = (String JavaDoc)_roleNameList.elementAt(index);
218         }
219         return mArray;
220     } //-- java.lang.String[] getRoleName()
221

222     /**
223      * Method getRoleNameCount
224      */

225     public int getRoleNameCount()
226     {
227         return _roleNameList.size();
228     } //-- int getRoleNameCount()
229

230     /**
231      * Method isValid
232      */

233     public boolean isValid()
234     {
235         try {
236             validate();
237         }
238         catch (org.exolab.castor.xml.ValidationException vex) {
239             return false;
240         }
241         return true;
242     } //-- boolean isValid()
243

244     /**
245      * Method marshal
246      *
247      * @param out
248      */

249     public void marshal(java.io.Writer JavaDoc out)
250         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
251     {
252         
253         Marshaller.marshal(this, out);
254     } //-- void marshal(java.io.Writer)
255

256     /**
257      * Method marshal
258      *
259      * @param handler
260      */

261     public void marshal(org.xml.sax.ContentHandler JavaDoc handler)
262         throws java.io.IOException JavaDoc, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
263     {
264         
265         Marshaller.marshal(this, handler);
266     } //-- void marshal(org.xml.sax.ContentHandler)
267

268     /**
269      * Method removeAllMethod
270      */

271     public void removeAllMethod()
272     {
273         _methodList.removeAllElements();
274     } //-- void removeAllMethod()
275

276     /**
277      * Method removeAllRoleName
278      */

279     public void removeAllRoleName()
280     {
281         _roleNameList.removeAllElements();
282     } //-- void removeAllRoleName()
283

284     /**
285      * Method removeMethod
286      *
287      * @param index
288      */

289     public org.openejb.alt.config.ejb11.Method removeMethod(int index)
290     {
291         java.lang.Object JavaDoc obj = _methodList.elementAt(index);
292         _methodList.removeElementAt(index);
293         return (org.openejb.alt.config.ejb11.Method) obj;
294     } //-- org.openejb.alt.config.ejb11.Method removeMethod(int)
295

296     /**
297      * Method removeRoleName
298      *
299      * @param index
300      */

301     public java.lang.String JavaDoc removeRoleName(int index)
302     {
303         java.lang.Object JavaDoc obj = _roleNameList.elementAt(index);
304         _roleNameList.removeElementAt(index);
305         return (String JavaDoc)obj;
306     } //-- java.lang.String removeRoleName(int)
307

308     /**
309      * Sets the value of field 'description'.
310      *
311      * @param description the value of field 'description'.
312      */

313     public void setDescription(java.lang.String JavaDoc description)
314     {
315         this._description = description;
316     } //-- void setDescription(java.lang.String)
317

318     /**
319      * Sets the value of field 'id'.
320      *
321      * @param id the value of field 'id'.
322      */

323     public void setId(java.lang.String JavaDoc id)
324     {
325         this._id = id;
326     } //-- void setId(java.lang.String)
327

328     /**
329      * Method setMethod
330      *
331      * @param index
332      * @param vMethod
333      */

334     public void setMethod(int index, org.openejb.alt.config.ejb11.Method vMethod)
335         throws java.lang.IndexOutOfBoundsException JavaDoc
336     {
337         //-- check bounds for index
338
if ((index < 0) || (index > _methodList.size())) {
339             throw new IndexOutOfBoundsException JavaDoc();
340         }
341         _methodList.setElementAt(vMethod, index);
342     } //-- void setMethod(int, org.openejb.alt.config.ejb11.Method)
343

344     /**
345      * Method setMethod
346      *
347      * @param methodArray
348      */

349     public void setMethod(org.openejb.alt.config.ejb11.Method[] methodArray)
350     {
351         //-- copy array
352
_methodList.removeAllElements();
353         for (int i = 0; i < methodArray.length; i++) {
354             _methodList.addElement(methodArray[i]);
355         }
356     } //-- void setMethod(org.openejb.alt.config.ejb11.Method)
357

358     /**
359      * Method setRoleName
360      *
361      * @param index
362      * @param vRoleName
363      */

364     public void setRoleName(int index, java.lang.String JavaDoc vRoleName)
365         throws java.lang.IndexOutOfBoundsException JavaDoc
366     {
367         //-- check bounds for index
368
if ((index < 0) || (index > _roleNameList.size())) {
369             throw new IndexOutOfBoundsException JavaDoc();
370         }
371         _roleNameList.setElementAt(vRoleName, index);
372     } //-- void setRoleName(int, java.lang.String)
373

374     /**
375      * Method setRoleName
376      *
377      * @param roleNameArray
378      */

379     public void setRoleName(java.lang.String JavaDoc[] roleNameArray)
380     {
381         //-- copy array
382
_roleNameList.removeAllElements();
383         for (int i = 0; i < roleNameArray.length; i++) {
384             _roleNameList.addElement(roleNameArray[i]);
385         }
386     } //-- void setRoleName(java.lang.String)
387

388     /**
389      * Method unmarshal
390      *
391      * @param reader
392      */

393     public static java.lang.Object JavaDoc unmarshal(java.io.Reader JavaDoc reader)
394         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
395     {
396         return (org.openejb.alt.config.ejb11.MethodPermission) Unmarshaller.unmarshal(org.openejb.alt.config.ejb11.MethodPermission.class, reader);
397     } //-- java.lang.Object unmarshal(java.io.Reader)
398

399     /**
400      * Method validate
401      */

402     public void validate()
403         throws org.exolab.castor.xml.ValidationException
404     {
405         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
406         validator.validate(this);
407     } //-- void validate()
408

409 }
410
Popular Tags