KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

38     /**
39      * Field _ejbDeploymentList
40      */

41     private java.util.Vector JavaDoc _ejbDeploymentList;
42
43
44       //----------------/
45
//- Constructors -/
46
//----------------/
47

48     public OpenejbJar() {
49         super();
50         _ejbDeploymentList = new Vector JavaDoc();
51     } //-- org.openejb.alt.config.ejb11.OpenejbJar()
52

53
54       //-----------/
55
//- Methods -/
56
//-----------/
57

58     /**
59      * Method addEjbDeployment
60      *
61      * @param vEjbDeployment
62      */

63     public void addEjbDeployment(org.openejb.alt.config.ejb11.EjbDeployment vEjbDeployment)
64         throws java.lang.IndexOutOfBoundsException JavaDoc
65     {
66         _ejbDeploymentList.addElement(vEjbDeployment);
67     } //-- void addEjbDeployment(org.openejb.alt.config.ejb11.EjbDeployment)
68

69     /**
70      * Method addEjbDeployment
71      *
72      * @param index
73      * @param vEjbDeployment
74      */

75     public void addEjbDeployment(int index, org.openejb.alt.config.ejb11.EjbDeployment vEjbDeployment)
76         throws java.lang.IndexOutOfBoundsException JavaDoc
77     {
78         _ejbDeploymentList.insertElementAt(vEjbDeployment, index);
79     } //-- void addEjbDeployment(int, org.openejb.alt.config.ejb11.EjbDeployment)
80

81     /**
82      * Method enumerateEjbDeployment
83      */

84     public java.util.Enumeration JavaDoc enumerateEjbDeployment()
85     {
86         return _ejbDeploymentList.elements();
87     } //-- java.util.Enumeration enumerateEjbDeployment()
88

89     /**
90      * Method getEjbDeployment
91      *
92      * @param index
93      */

94     public org.openejb.alt.config.ejb11.EjbDeployment getEjbDeployment(int index)
95         throws java.lang.IndexOutOfBoundsException JavaDoc
96     {
97         //-- check bounds for index
98
if ((index < 0) || (index > _ejbDeploymentList.size())) {
99             throw new IndexOutOfBoundsException JavaDoc();
100         }
101         
102         return (org.openejb.alt.config.ejb11.EjbDeployment) _ejbDeploymentList.elementAt(index);
103     } //-- org.openejb.alt.config.ejb11.EjbDeployment getEjbDeployment(int)
104

105     /**
106      * Method getEjbDeployment
107      */

108     public org.openejb.alt.config.ejb11.EjbDeployment[] getEjbDeployment()
109     {
110         int size = _ejbDeploymentList.size();
111         org.openejb.alt.config.ejb11.EjbDeployment[] mArray = new org.openejb.alt.config.ejb11.EjbDeployment[size];
112         for (int index = 0; index < size; index++) {
113             mArray[index] = (org.openejb.alt.config.ejb11.EjbDeployment) _ejbDeploymentList.elementAt(index);
114         }
115         return mArray;
116     } //-- org.openejb.alt.config.ejb11.EjbDeployment[] getEjbDeployment()
117

118     /**
119      * Method getEjbDeploymentCount
120      */

121     public int getEjbDeploymentCount()
122     {
123         return _ejbDeploymentList.size();
124     } //-- int getEjbDeploymentCount()
125

126     /**
127      * Method isValid
128      */

129     public boolean isValid()
130     {
131         try {
132             validate();
133         }
134         catch (org.exolab.castor.xml.ValidationException vex) {
135             return false;
136         }
137         return true;
138     } //-- boolean isValid()
139

140     /**
141      * Method marshal
142      *
143      * @param out
144      */

145     public void marshal(java.io.Writer JavaDoc out)
146         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
147     {
148         
149         Marshaller.marshal(this, out);
150     } //-- void marshal(java.io.Writer)
151

152     /**
153      * Method marshal
154      *
155      * @param handler
156      */

157     public void marshal(org.xml.sax.ContentHandler JavaDoc handler)
158         throws java.io.IOException JavaDoc, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
159     {
160         
161         Marshaller.marshal(this, handler);
162     } //-- void marshal(org.xml.sax.ContentHandler)
163

164     /**
165      * Method removeAllEjbDeployment
166      */

167     public void removeAllEjbDeployment()
168     {
169         _ejbDeploymentList.removeAllElements();
170     } //-- void removeAllEjbDeployment()
171

172     /**
173      * Method removeEjbDeployment
174      *
175      * @param index
176      */

177     public org.openejb.alt.config.ejb11.EjbDeployment removeEjbDeployment(int index)
178     {
179         java.lang.Object JavaDoc obj = _ejbDeploymentList.elementAt(index);
180         _ejbDeploymentList.removeElementAt(index);
181         return (org.openejb.alt.config.ejb11.EjbDeployment) obj;
182     } //-- org.openejb.alt.config.ejb11.EjbDeployment removeEjbDeployment(int)
183

184     /**
185      * Method setEjbDeployment
186      *
187      * @param index
188      * @param vEjbDeployment
189      */

190     public void setEjbDeployment(int index, org.openejb.alt.config.ejb11.EjbDeployment vEjbDeployment)
191         throws java.lang.IndexOutOfBoundsException JavaDoc
192     {
193         //-- check bounds for index
194
if ((index < 0) || (index > _ejbDeploymentList.size())) {
195             throw new IndexOutOfBoundsException JavaDoc();
196         }
197         _ejbDeploymentList.setElementAt(vEjbDeployment, index);
198     } //-- void setEjbDeployment(int, org.openejb.alt.config.ejb11.EjbDeployment)
199

200     /**
201      * Method setEjbDeployment
202      *
203      * @param ejbDeploymentArray
204      */

205     public void setEjbDeployment(org.openejb.alt.config.ejb11.EjbDeployment[] ejbDeploymentArray)
206     {
207         //-- copy array
208
_ejbDeploymentList.removeAllElements();
209         for (int i = 0; i < ejbDeploymentArray.length; i++) {
210             _ejbDeploymentList.addElement(ejbDeploymentArray[i]);
211         }
212     } //-- void setEjbDeployment(org.openejb.alt.config.ejb11.EjbDeployment)
213

214     /**
215      * Method unmarshal
216      *
217      * @param reader
218      */

219     public static java.lang.Object JavaDoc unmarshal(java.io.Reader JavaDoc reader)
220         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
221     {
222         return (org.openejb.alt.config.ejb11.OpenejbJar) Unmarshaller.unmarshal(org.openejb.alt.config.ejb11.OpenejbJar.class, reader);
223     } //-- java.lang.Object unmarshal(java.io.Reader)
224

225     /**
226      * Method validate
227      */

228     public void validate()
229         throws org.exolab.castor.xml.ValidationException
230     {
231         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
232         validator.validate(this);
233     } //-- void validate()
234

235 }
236
Popular Tags