KickJava   Java API By Example, From Geeks To Geeks.

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


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

31 public class EnterpriseBeans 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 _items
45      */

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

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

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

63     /**
64      * Method addEnterpriseBeansItem
65      *
66      * @param vEnterpriseBeansItem
67      */

68     public void addEnterpriseBeansItem(org.openejb.alt.config.ejb11.EnterpriseBeansItem vEnterpriseBeansItem)
69         throws java.lang.IndexOutOfBoundsException JavaDoc
70     {
71         _items.addElement(vEnterpriseBeansItem);
72     } //-- void addEnterpriseBeansItem(org.openejb.alt.config.ejb11.EnterpriseBeansItem)
73

74     /**
75      * Method addEnterpriseBeansItem
76      *
77      * @param index
78      * @param vEnterpriseBeansItem
79      */

80     public void addEnterpriseBeansItem(int index, org.openejb.alt.config.ejb11.EnterpriseBeansItem vEnterpriseBeansItem)
81         throws java.lang.IndexOutOfBoundsException JavaDoc
82     {
83         _items.insertElementAt(vEnterpriseBeansItem, index);
84     } //-- void addEnterpriseBeansItem(int, org.openejb.alt.config.ejb11.EnterpriseBeansItem)
85

86     /**
87      * Method enumerateEnterpriseBeansItem
88      */

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

94     /**
95      * Method getEnterpriseBeansItem
96      *
97      * @param index
98      */

99     public org.openejb.alt.config.ejb11.EnterpriseBeansItem getEnterpriseBeansItem(int index)
100         throws java.lang.IndexOutOfBoundsException JavaDoc
101     {
102         //-- check bounds for index
103
if ((index < 0) || (index > _items.size())) {
104             throw new IndexOutOfBoundsException JavaDoc();
105         }
106         
107         return (org.openejb.alt.config.ejb11.EnterpriseBeansItem) _items.elementAt(index);
108     } //-- org.openejb.alt.config.ejb11.EnterpriseBeansItem getEnterpriseBeansItem(int)
109

110     /**
111      * Method getEnterpriseBeansItem
112      */

113     public org.openejb.alt.config.ejb11.EnterpriseBeansItem[] getEnterpriseBeansItem()
114     {
115         int size = _items.size();
116         org.openejb.alt.config.ejb11.EnterpriseBeansItem[] mArray = new org.openejb.alt.config.ejb11.EnterpriseBeansItem[size];
117         for (int index = 0; index < size; index++) {
118             mArray[index] = (org.openejb.alt.config.ejb11.EnterpriseBeansItem) _items.elementAt(index);
119         }
120         return mArray;
121     } //-- org.openejb.alt.config.ejb11.EnterpriseBeansItem[] getEnterpriseBeansItem()
122

123     /**
124      * Method getEnterpriseBeansItemCount
125      */

126     public int getEnterpriseBeansItemCount()
127     {
128         return _items.size();
129     } //-- int getEnterpriseBeansItemCount()
130

131     /**
132      * Returns the value of field 'id'.
133      *
134      * @return the value of field 'id'.
135      */

136     public java.lang.String JavaDoc getId()
137     {
138         return this._id;
139     } //-- java.lang.String getId()
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 removeAllEnterpriseBeansItem
181      */

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

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

192     public org.openejb.alt.config.ejb11.EnterpriseBeansItem removeEnterpriseBeansItem(int index)
193     {
194         java.lang.Object JavaDoc obj = _items.elementAt(index);
195         _items.removeElementAt(index);
196         return (org.openejb.alt.config.ejb11.EnterpriseBeansItem) obj;
197     } //-- org.openejb.alt.config.ejb11.EnterpriseBeansItem removeEnterpriseBeansItem(int)
198

199     /**
200      * Method setEnterpriseBeansItem
201      *
202      * @param index
203      * @param vEnterpriseBeansItem
204      */

205     public void setEnterpriseBeansItem(int index, org.openejb.alt.config.ejb11.EnterpriseBeansItem vEnterpriseBeansItem)
206         throws java.lang.IndexOutOfBoundsException JavaDoc
207     {
208         //-- check bounds for index
209
if ((index < 0) || (index > _items.size())) {
210             throw new IndexOutOfBoundsException JavaDoc();
211         }
212         _items.setElementAt(vEnterpriseBeansItem, index);
213     } //-- void setEnterpriseBeansItem(int, org.openejb.alt.config.ejb11.EnterpriseBeansItem)
214

215     /**
216      * Method setEnterpriseBeansItem
217      *
218      * @param enterpriseBeansItemArray
219      */

220     public void setEnterpriseBeansItem(org.openejb.alt.config.ejb11.EnterpriseBeansItem[] enterpriseBeansItemArray)
221     {
222         //-- copy array
223
_items.removeAllElements();
224         for (int i = 0; i < enterpriseBeansItemArray.length; i++) {
225             _items.addElement(enterpriseBeansItemArray[i]);
226         }
227     } //-- void setEnterpriseBeansItem(org.openejb.alt.config.ejb11.EnterpriseBeansItem)
228

229     /**
230      * Sets the value of field 'id'.
231      *
232      * @param id the value of field 'id'.
233      */

234     public void setId(java.lang.String JavaDoc id)
235     {
236         this._id = id;
237     } //-- void setId(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.EnterpriseBeans) Unmarshaller.unmarshal(org.openejb.alt.config.ejb11.EnterpriseBeans.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