View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 0.9.7</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package fr.in2p3.jsaga.engine.schema.config;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import java.io.IOException;
15  import java.io.Reader;
16  import java.io.Serializable;
17  import java.io.Writer;
18  import java.util.ArrayList;
19  import java.util.Enumeration;
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;
25  
26  /**
27   * Class Execution.
28   * 
29   * @version $Revision$ $Date$
30   */
31  public class Execution extends fr.in2p3.jsaga.engine.schema.config.ObjectType 
32  implements java.io.Serializable
33  {
34  
35  
36        //--------------------------/
37       //- Class/Member Variables -/
38      //--------------------------/
39  
40      /**
41       * Field _type
42       */
43      private java.lang.String _type;
44  
45      /**
46       * Field _impl
47       */
48      private java.lang.String _impl;
49  
50      /**
51       * Field _usage
52       */
53      private java.lang.String _usage;
54  
55      /**
56       * Field _monitorService
57       */
58      private fr.in2p3.jsaga.engine.schema.config.MonitorService _monitorService;
59  
60      /**
61       * Field _supportedContextTypeList
62       */
63      private java.util.ArrayList _supportedContextTypeList;
64  
65  
66        //----------------/
67       //- Constructors -/
68      //----------------/
69  
70      public Execution() 
71       {
72          super();
73          _supportedContextTypeList = new ArrayList();
74      } //-- fr.in2p3.jsaga.engine.schema.config.Execution()
75  
76  
77        //-----------/
78       //- Methods -/
79      //-----------/
80  
81      /**
82       * Method addSupportedContextType
83       * 
84       * 
85       * 
86       * @param vSupportedContextType
87       */
88      public void addSupportedContextType(java.lang.String vSupportedContextType)
89          throws java.lang.IndexOutOfBoundsException
90      {
91          _supportedContextTypeList.add(vSupportedContextType);
92      } //-- void addSupportedContextType(java.lang.String) 
93  
94      /**
95       * Method addSupportedContextType
96       * 
97       * 
98       * 
99       * @param index
100      * @param vSupportedContextType
101      */
102     public void addSupportedContextType(int index, java.lang.String vSupportedContextType)
103         throws java.lang.IndexOutOfBoundsException
104     {
105         _supportedContextTypeList.add(index, vSupportedContextType);
106     } //-- void addSupportedContextType(int, java.lang.String) 
107 
108     /**
109      * Method clearSupportedContextType
110      * 
111      */
112     public void clearSupportedContextType()
113     {
114         _supportedContextTypeList.clear();
115     } //-- void clearSupportedContextType() 
116 
117     /**
118      * Method enumerateSupportedContextType
119      * 
120      * 
121      * 
122      * @return Enumeration
123      */
124     public java.util.Enumeration enumerateSupportedContextType()
125     {
126         return new org.exolab.castor.util.IteratorEnumeration(_supportedContextTypeList.iterator());
127     } //-- java.util.Enumeration enumerateSupportedContextType() 
128 
129     /**
130      * Returns the value of field 'impl'.
131      * 
132      * @return String
133      * @return the value of field 'impl'.
134      */
135     public java.lang.String getImpl()
136     {
137         return this._impl;
138     } //-- java.lang.String getImpl() 
139 
140     /**
141      * Returns the value of field 'monitorService'.
142      * 
143      * @return MonitorService
144      * @return the value of field 'monitorService'.
145      */
146     public fr.in2p3.jsaga.engine.schema.config.MonitorService getMonitorService()
147     {
148         return this._monitorService;
149     } //-- fr.in2p3.jsaga.engine.schema.config.MonitorService getMonitorService() 
150 
151     /**
152      * Method getSupportedContextType
153      * 
154      * 
155      * 
156      * @param index
157      * @return String
158      */
159     public java.lang.String getSupportedContextType(int index)
160         throws java.lang.IndexOutOfBoundsException
161     {
162         //-- check bounds for index
163         if ((index < 0) || (index > _supportedContextTypeList.size())) {
164             throw new IndexOutOfBoundsException();
165         }
166         
167         return (String)_supportedContextTypeList.get(index);
168     } //-- java.lang.String getSupportedContextType(int) 
169 
170     /**
171      * Method getSupportedContextType
172      * 
173      * 
174      * 
175      * @return String
176      */
177     public java.lang.String[] getSupportedContextType()
178     {
179         int size = _supportedContextTypeList.size();
180         java.lang.String[] mArray = new java.lang.String[size];
181         for (int index = 0; index < size; index++) {
182             mArray[index] = (String)_supportedContextTypeList.get(index);
183         }
184         return mArray;
185     } //-- java.lang.String[] getSupportedContextType() 
186 
187     /**
188      * Method getSupportedContextTypeCount
189      * 
190      * 
191      * 
192      * @return int
193      */
194     public int getSupportedContextTypeCount()
195     {
196         return _supportedContextTypeList.size();
197     } //-- int getSupportedContextTypeCount() 
198 
199     /**
200      * Returns the value of field 'type'.
201      * 
202      * @return String
203      * @return the value of field 'type'.
204      */
205     public java.lang.String getType()
206     {
207         return this._type;
208     } //-- java.lang.String getType() 
209 
210     /**
211      * Returns the value of field 'usage'.
212      * 
213      * @return String
214      * @return the value of field 'usage'.
215      */
216     public java.lang.String getUsage()
217     {
218         return this._usage;
219     } //-- java.lang.String getUsage() 
220 
221     /**
222      * Method isValid
223      * 
224      * 
225      * 
226      * @return boolean
227      */
228     public boolean isValid()
229     {
230         try {
231             validate();
232         }
233         catch (org.exolab.castor.xml.ValidationException vex) {
234             return false;
235         }
236         return true;
237     } //-- boolean isValid() 
238 
239     /**
240      * Method marshal
241      * 
242      * 
243      * 
244      * @param out
245      */
246     public void marshal(java.io.Writer out)
247         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
248     {
249         
250         Marshaller.marshal(this, out);
251     } //-- void marshal(java.io.Writer) 
252 
253     /**
254      * Method marshal
255      * 
256      * 
257      * 
258      * @param handler
259      */
260     public void marshal(org.xml.sax.ContentHandler handler)
261         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
262     {
263         
264         Marshaller.marshal(this, handler);
265     } //-- void marshal(org.xml.sax.ContentHandler) 
266 
267     /**
268      * Method removeSupportedContextType
269      * 
270      * 
271      * 
272      * @param vSupportedContextType
273      * @return boolean
274      */
275     public boolean removeSupportedContextType(java.lang.String vSupportedContextType)
276     {
277         boolean removed = _supportedContextTypeList.remove(vSupportedContextType);
278         return removed;
279     } //-- boolean removeSupportedContextType(java.lang.String) 
280 
281     /**
282      * Sets the value of field 'impl'.
283      * 
284      * @param impl the value of field 'impl'.
285      */
286     public void setImpl(java.lang.String impl)
287     {
288         this._impl = impl;
289     } //-- void setImpl(java.lang.String) 
290 
291     /**
292      * Sets the value of field 'monitorService'.
293      * 
294      * @param monitorService the value of field 'monitorService'.
295      */
296     public void setMonitorService(fr.in2p3.jsaga.engine.schema.config.MonitorService monitorService)
297     {
298         this._monitorService = monitorService;
299     } //-- void setMonitorService(fr.in2p3.jsaga.engine.schema.config.MonitorService) 
300 
301     /**
302      * Method setSupportedContextType
303      * 
304      * 
305      * 
306      * @param index
307      * @param vSupportedContextType
308      */
309     public void setSupportedContextType(int index, java.lang.String vSupportedContextType)
310         throws java.lang.IndexOutOfBoundsException
311     {
312         //-- check bounds for index
313         if ((index < 0) || (index > _supportedContextTypeList.size())) {
314             throw new IndexOutOfBoundsException();
315         }
316         _supportedContextTypeList.set(index, vSupportedContextType);
317     } //-- void setSupportedContextType(int, java.lang.String) 
318 
319     /**
320      * Method setSupportedContextType
321      * 
322      * 
323      * 
324      * @param supportedContextTypeArray
325      */
326     public void setSupportedContextType(java.lang.String[] supportedContextTypeArray)
327     {
328         //-- copy array
329         _supportedContextTypeList.clear();
330         for (int i = 0; i < supportedContextTypeArray.length; i++) {
331             _supportedContextTypeList.add(supportedContextTypeArray[i]);
332         }
333     } //-- void setSupportedContextType(java.lang.String) 
334 
335     /**
336      * Sets the value of field 'type'.
337      * 
338      * @param type the value of field 'type'.
339      */
340     public void setType(java.lang.String type)
341     {
342         this._type = type;
343     } //-- void setType(java.lang.String) 
344 
345     /**
346      * Sets the value of field 'usage'.
347      * 
348      * @param usage the value of field 'usage'.
349      */
350     public void setUsage(java.lang.String usage)
351     {
352         this._usage = usage;
353     } //-- void setUsage(java.lang.String) 
354 
355     /**
356      * Method unmarshal
357      * 
358      * 
359      * 
360      * @param reader
361      * @return Object
362      */
363     public static java.lang.Object unmarshal(java.io.Reader reader)
364         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
365     {
366         return (fr.in2p3.jsaga.engine.schema.config.Execution) Unmarshaller.unmarshal(fr.in2p3.jsaga.engine.schema.config.Execution.class, reader);
367     } //-- java.lang.Object unmarshal(java.io.Reader) 
368 
369     /**
370      * Method validate
371      * 
372      */
373     public void validate()
374         throws org.exolab.castor.xml.ValidationException
375     {
376         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
377         validator.validate(this);
378     } //-- void validate() 
379 
380 }