KickJava   Java API By Example, From Geeks To Geeks.

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


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

31 public class ContainerTransaction 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 _methodList
50      */

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

56     private java.lang.String JavaDoc _transAttribute;
57
58
59       //----------------/
60
//- Constructors -/
61
//----------------/
62

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

68
69       //-----------/
70
//- Methods -/
71
//-----------/
72

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

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

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

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

96     /**
97      * Method enumerateMethod
98      */

99     public java.util.Enumeration JavaDoc enumerateMethod()
100     {
101         return _methodList.elements();
102     } //-- java.util.Enumeration enumerateMethod()
103

104     /**
105      * Returns the value of field 'description'.
106      *
107      * @return the value of field 'description'.
108      */

109     public java.lang.String JavaDoc getDescription()
110     {
111         return this._description;
112     } //-- java.lang.String getDescription()
113

114     /**
115      * Returns the value of field 'id'.
116      *
117      * @return the value of field 'id'.
118      */

119     public java.lang.String JavaDoc getId()
120     {
121         return this._id;
122     } //-- java.lang.String getId()
123

124     /**
125      * Method getMethod
126      *
127      * @param index
128      */

129     public org.openejb.alt.config.ejb11.Method getMethod(int index)
130         throws java.lang.IndexOutOfBoundsException JavaDoc
131     {
132         //-- check bounds for index
133
if ((index < 0) || (index > _methodList.size())) {
134             throw new IndexOutOfBoundsException JavaDoc();
135         }
136         
137         return (org.openejb.alt.config.ejb11.Method) _methodList.elementAt(index);
138     } //-- org.openejb.alt.config.ejb11.Method getMethod(int)
139

140     /**
141      * Method getMethod
142      */

143     public org.openejb.alt.config.ejb11.Method[] getMethod()
144     {
145         int size = _methodList.size();
146         org.openejb.alt.config.ejb11.Method[] mArray = new org.openejb.alt.config.ejb11.Method[size];
147         for (int index = 0; index < size; index++) {
148             mArray[index] = (org.openejb.alt.config.ejb11.Method) _methodList.elementAt(index);
149         }
150         return mArray;
151     } //-- org.openejb.alt.config.ejb11.Method[] getMethod()
152

153     /**
154      * Method getMethodCount
155      */

156     public int getMethodCount()
157     {
158         return _methodList.size();
159     } //-- int getMethodCount()
160

161     /**
162      * Returns the value of field 'transAttribute'.
163      *
164      * @return the value of field 'transAttribute'.
165      */

166     public java.lang.String JavaDoc getTransAttribute()
167     {
168         return this._transAttribute;
169     } //-- java.lang.String getTransAttribute()
170

171     /**
172      * Method isValid
173      */

174     public boolean isValid()
175     {
176         try {
177             validate();
178         }
179         catch (org.exolab.castor.xml.ValidationException vex) {
180             return false;
181         }
182         return true;
183     } //-- boolean isValid()
184

185     /**
186      * Method marshal
187      *
188      * @param out
189      */

190     public void marshal(java.io.Writer JavaDoc out)
191         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
192     {
193         
194         Marshaller.marshal(this, out);
195     } //-- void marshal(java.io.Writer)
196

197     /**
198      * Method marshal
199      *
200      * @param handler
201      */

202     public void marshal(org.xml.sax.ContentHandler JavaDoc handler)
203         throws java.io.IOException JavaDoc, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
204     {
205         
206         Marshaller.marshal(this, handler);
207     } //-- void marshal(org.xml.sax.ContentHandler)
208

209     /**
210      * Method removeAllMethod
211      */

212     public void removeAllMethod()
213     {
214         _methodList.removeAllElements();
215     } //-- void removeAllMethod()
216

217     /**
218      * Method removeMethod
219      *
220      * @param index
221      */

222     public org.openejb.alt.config.ejb11.Method removeMethod(int index)
223     {
224         java.lang.Object JavaDoc obj = _methodList.elementAt(index);
225         _methodList.removeElementAt(index);
226         return (org.openejb.alt.config.ejb11.Method) obj;
227     } //-- org.openejb.alt.config.ejb11.Method removeMethod(int)
228

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

234     public void setDescription(java.lang.String JavaDoc description)
235     {
236         this._description = description;
237     } //-- void setDescription(java.lang.String)
238

239     /**
240      * Sets the value of field 'id'.
241      *
242      * @param id the value of field 'id'.
243      */

244     public void setId(java.lang.String JavaDoc id)
245     {
246         this._id = id;
247     } //-- void setId(java.lang.String)
248

249     /**
250      * Method setMethod
251      *
252      * @param index
253      * @param vMethod
254      */

255     public void setMethod(int index, org.openejb.alt.config.ejb11.Method vMethod)
256         throws java.lang.IndexOutOfBoundsException JavaDoc
257     {
258         //-- check bounds for index
259
if ((index < 0) || (index > _methodList.size())) {
260             throw new IndexOutOfBoundsException JavaDoc();
261         }
262         _methodList.setElementAt(vMethod, index);
263     } //-- void setMethod(int, org.openejb.alt.config.ejb11.Method)
264

265     /**
266      * Method setMethod
267      *
268      * @param methodArray
269      */

270     public void setMethod(org.openejb.alt.config.ejb11.Method[] methodArray)
271     {
272         //-- copy array
273
_methodList.removeAllElements();
274         for (int i = 0; i < methodArray.length; i++) {
275             _methodList.addElement(methodArray[i]);
276         }
277     } //-- void setMethod(org.openejb.alt.config.ejb11.Method)
278

279     /**
280      * Sets the value of field 'transAttribute'.
281      *
282      * @param transAttribute the value of field 'transAttribute'.
283      */

284     public void setTransAttribute(java.lang.String JavaDoc transAttribute)
285     {
286         this._transAttribute = transAttribute;
287     } //-- void setTransAttribute(java.lang.String)
288

289     /**
290      * Method unmarshal
291      *
292      * @param reader
293      */

294     public static java.lang.Object JavaDoc unmarshal(java.io.Reader JavaDoc reader)
295         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
296     {
297         return (org.openejb.alt.config.ejb11.ContainerTransaction) Unmarshaller.unmarshal(org.openejb.alt.config.ejb11.ContainerTransaction.class, reader);
298     } //-- java.lang.Object unmarshal(java.io.Reader)
299

300     /**
301      * Method validate
302      */

303     public void validate()
304         throws org.exolab.castor.xml.ValidationException
305     {
306         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
307         validator.validate(this);
308     } //-- void validate()
309

310 }
311
Popular Tags