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 Protocol.
28   * 
29   * @version $Revision$ $Date$
30   */
31  public class Protocol 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 _read
57       */
58      private boolean _read;
59  
60      /**
61       * keeps track of state for field: _read
62       */
63      private boolean _has_read;
64  
65      /**
66       * Field _write
67       */
68      private boolean _write;
69  
70      /**
71       * keeps track of state for field: _write
72       */
73      private boolean _has_write;
74  
75      /**
76       * Field _thirdparty
77       */
78      private boolean _thirdparty;
79  
80      /**
81       * keeps track of state for field: _thirdparty
82       */
83      private boolean _has_thirdparty;
84  
85      /**
86       * Field _logical
87       */
88      private boolean _logical;
89  
90      /**
91       * keeps track of state for field: _logical
92       */
93      private boolean _has_logical;
94  
95      /**
96       * Field _supportedContextTypeList
97       */
98      private java.util.ArrayList _supportedContextTypeList;
99  
100 
101       //----------------/
102      //- Constructors -/
103     //----------------/
104 
105     public Protocol() 
106      {
107         super();
108         _supportedContextTypeList = new ArrayList();
109     } //-- fr.in2p3.jsaga.engine.schema.config.Protocol()
110 
111 
112       //-----------/
113      //- Methods -/
114     //-----------/
115 
116     /**
117      * Method addSupportedContextType
118      * 
119      * 
120      * 
121      * @param vSupportedContextType
122      */
123     public void addSupportedContextType(java.lang.String vSupportedContextType)
124         throws java.lang.IndexOutOfBoundsException
125     {
126         _supportedContextTypeList.add(vSupportedContextType);
127     } //-- void addSupportedContextType(java.lang.String) 
128 
129     /**
130      * Method addSupportedContextType
131      * 
132      * 
133      * 
134      * @param index
135      * @param vSupportedContextType
136      */
137     public void addSupportedContextType(int index, java.lang.String vSupportedContextType)
138         throws java.lang.IndexOutOfBoundsException
139     {
140         _supportedContextTypeList.add(index, vSupportedContextType);
141     } //-- void addSupportedContextType(int, java.lang.String) 
142 
143     /**
144      * Method clearSupportedContextType
145      * 
146      */
147     public void clearSupportedContextType()
148     {
149         _supportedContextTypeList.clear();
150     } //-- void clearSupportedContextType() 
151 
152     /**
153      * Method deleteLogical
154      * 
155      */
156     public void deleteLogical()
157     {
158         this._has_logical= false;
159     } //-- void deleteLogical() 
160 
161     /**
162      * Method deleteRead
163      * 
164      */
165     public void deleteRead()
166     {
167         this._has_read= false;
168     } //-- void deleteRead() 
169 
170     /**
171      * Method deleteThirdparty
172      * 
173      */
174     public void deleteThirdparty()
175     {
176         this._has_thirdparty= false;
177     } //-- void deleteThirdparty() 
178 
179     /**
180      * Method deleteWrite
181      * 
182      */
183     public void deleteWrite()
184     {
185         this._has_write= false;
186     } //-- void deleteWrite() 
187 
188     /**
189      * Method enumerateSupportedContextType
190      * 
191      * 
192      * 
193      * @return Enumeration
194      */
195     public java.util.Enumeration enumerateSupportedContextType()
196     {
197         return new org.exolab.castor.util.IteratorEnumeration(_supportedContextTypeList.iterator());
198     } //-- java.util.Enumeration enumerateSupportedContextType() 
199 
200     /**
201      * Returns the value of field 'impl'.
202      * 
203      * @return String
204      * @return the value of field 'impl'.
205      */
206     public java.lang.String getImpl()
207     {
208         return this._impl;
209     } //-- java.lang.String getImpl() 
210 
211     /**
212      * Returns the value of field 'logical'.
213      * 
214      * @return boolean
215      * @return the value of field 'logical'.
216      */
217     public boolean getLogical()
218     {
219         return this._logical;
220     } //-- boolean getLogical() 
221 
222     /**
223      * Returns the value of field 'read'.
224      * 
225      * @return boolean
226      * @return the value of field 'read'.
227      */
228     public boolean getRead()
229     {
230         return this._read;
231     } //-- boolean getRead() 
232 
233     /**
234      * Method getSupportedContextType
235      * 
236      * 
237      * 
238      * @param index
239      * @return String
240      */
241     public java.lang.String getSupportedContextType(int index)
242         throws java.lang.IndexOutOfBoundsException
243     {
244         //-- check bounds for index
245         if ((index < 0) || (index > _supportedContextTypeList.size())) {
246             throw new IndexOutOfBoundsException();
247         }
248         
249         return (String)_supportedContextTypeList.get(index);
250     } //-- java.lang.String getSupportedContextType(int) 
251 
252     /**
253      * Method getSupportedContextType
254      * 
255      * 
256      * 
257      * @return String
258      */
259     public java.lang.String[] getSupportedContextType()
260     {
261         int size = _supportedContextTypeList.size();
262         java.lang.String[] mArray = new java.lang.String[size];
263         for (int index = 0; index < size; index++) {
264             mArray[index] = (String)_supportedContextTypeList.get(index);
265         }
266         return mArray;
267     } //-- java.lang.String[] getSupportedContextType() 
268 
269     /**
270      * Method getSupportedContextTypeCount
271      * 
272      * 
273      * 
274      * @return int
275      */
276     public int getSupportedContextTypeCount()
277     {
278         return _supportedContextTypeList.size();
279     } //-- int getSupportedContextTypeCount() 
280 
281     /**
282      * Returns the value of field 'thirdparty'.
283      * 
284      * @return boolean
285      * @return the value of field 'thirdparty'.
286      */
287     public boolean getThirdparty()
288     {
289         return this._thirdparty;
290     } //-- boolean getThirdparty() 
291 
292     /**
293      * Returns the value of field 'type'.
294      * 
295      * @return String
296      * @return the value of field 'type'.
297      */
298     public java.lang.String getType()
299     {
300         return this._type;
301     } //-- java.lang.String getType() 
302 
303     /**
304      * Returns the value of field 'usage'.
305      * 
306      * @return String
307      * @return the value of field 'usage'.
308      */
309     public java.lang.String getUsage()
310     {
311         return this._usage;
312     } //-- java.lang.String getUsage() 
313 
314     /**
315      * Returns the value of field 'write'.
316      * 
317      * @return boolean
318      * @return the value of field 'write'.
319      */
320     public boolean getWrite()
321     {
322         return this._write;
323     } //-- boolean getWrite() 
324 
325     /**
326      * Method hasLogical
327      * 
328      * 
329      * 
330      * @return boolean
331      */
332     public boolean hasLogical()
333     {
334         return this._has_logical;
335     } //-- boolean hasLogical() 
336 
337     /**
338      * Method hasRead
339      * 
340      * 
341      * 
342      * @return boolean
343      */
344     public boolean hasRead()
345     {
346         return this._has_read;
347     } //-- boolean hasRead() 
348 
349     /**
350      * Method hasThirdparty
351      * 
352      * 
353      * 
354      * @return boolean
355      */
356     public boolean hasThirdparty()
357     {
358         return this._has_thirdparty;
359     } //-- boolean hasThirdparty() 
360 
361     /**
362      * Method hasWrite
363      * 
364      * 
365      * 
366      * @return boolean
367      */
368     public boolean hasWrite()
369     {
370         return this._has_write;
371     } //-- boolean hasWrite() 
372 
373     /**
374      * Method isValid
375      * 
376      * 
377      * 
378      * @return boolean
379      */
380     public boolean isValid()
381     {
382         try {
383             validate();
384         }
385         catch (org.exolab.castor.xml.ValidationException vex) {
386             return false;
387         }
388         return true;
389     } //-- boolean isValid() 
390 
391     /**
392      * Method marshal
393      * 
394      * 
395      * 
396      * @param out
397      */
398     public void marshal(java.io.Writer out)
399         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
400     {
401         
402         Marshaller.marshal(this, out);
403     } //-- void marshal(java.io.Writer) 
404 
405     /**
406      * Method marshal
407      * 
408      * 
409      * 
410      * @param handler
411      */
412     public void marshal(org.xml.sax.ContentHandler handler)
413         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
414     {
415         
416         Marshaller.marshal(this, handler);
417     } //-- void marshal(org.xml.sax.ContentHandler) 
418 
419     /**
420      * Method removeSupportedContextType
421      * 
422      * 
423      * 
424      * @param vSupportedContextType
425      * @return boolean
426      */
427     public boolean removeSupportedContextType(java.lang.String vSupportedContextType)
428     {
429         boolean removed = _supportedContextTypeList.remove(vSupportedContextType);
430         return removed;
431     } //-- boolean removeSupportedContextType(java.lang.String) 
432 
433     /**
434      * Sets the value of field 'impl'.
435      * 
436      * @param impl the value of field 'impl'.
437      */
438     public void setImpl(java.lang.String impl)
439     {
440         this._impl = impl;
441     } //-- void setImpl(java.lang.String) 
442 
443     /**
444      * Sets the value of field 'logical'.
445      * 
446      * @param logical the value of field 'logical'.
447      */
448     public void setLogical(boolean logical)
449     {
450         this._logical = logical;
451         this._has_logical = true;
452     } //-- void setLogical(boolean) 
453 
454     /**
455      * Sets the value of field 'read'.
456      * 
457      * @param read the value of field 'read'.
458      */
459     public void setRead(boolean read)
460     {
461         this._read = read;
462         this._has_read = true;
463     } //-- void setRead(boolean) 
464 
465     /**
466      * Method setSupportedContextType
467      * 
468      * 
469      * 
470      * @param index
471      * @param vSupportedContextType
472      */
473     public void setSupportedContextType(int index, java.lang.String vSupportedContextType)
474         throws java.lang.IndexOutOfBoundsException
475     {
476         //-- check bounds for index
477         if ((index < 0) || (index > _supportedContextTypeList.size())) {
478             throw new IndexOutOfBoundsException();
479         }
480         _supportedContextTypeList.set(index, vSupportedContextType);
481     } //-- void setSupportedContextType(int, java.lang.String) 
482 
483     /**
484      * Method setSupportedContextType
485      * 
486      * 
487      * 
488      * @param supportedContextTypeArray
489      */
490     public void setSupportedContextType(java.lang.String[] supportedContextTypeArray)
491     {
492         //-- copy array
493         _supportedContextTypeList.clear();
494         for (int i = 0; i < supportedContextTypeArray.length; i++) {
495             _supportedContextTypeList.add(supportedContextTypeArray[i]);
496         }
497     } //-- void setSupportedContextType(java.lang.String) 
498 
499     /**
500      * Sets the value of field 'thirdparty'.
501      * 
502      * @param thirdparty the value of field 'thirdparty'.
503      */
504     public void setThirdparty(boolean thirdparty)
505     {
506         this._thirdparty = thirdparty;
507         this._has_thirdparty = true;
508     } //-- void setThirdparty(boolean) 
509 
510     /**
511      * Sets the value of field 'type'.
512      * 
513      * @param type the value of field 'type'.
514      */
515     public void setType(java.lang.String type)
516     {
517         this._type = type;
518     } //-- void setType(java.lang.String) 
519 
520     /**
521      * Sets the value of field 'usage'.
522      * 
523      * @param usage the value of field 'usage'.
524      */
525     public void setUsage(java.lang.String usage)
526     {
527         this._usage = usage;
528     } //-- void setUsage(java.lang.String) 
529 
530     /**
531      * Sets the value of field 'write'.
532      * 
533      * @param write the value of field 'write'.
534      */
535     public void setWrite(boolean write)
536     {
537         this._write = write;
538         this._has_write = true;
539     } //-- void setWrite(boolean) 
540 
541     /**
542      * Method unmarshal
543      * 
544      * 
545      * 
546      * @param reader
547      * @return Object
548      */
549     public static java.lang.Object unmarshal(java.io.Reader reader)
550         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
551     {
552         return (fr.in2p3.jsaga.engine.schema.config.Protocol) Unmarshaller.unmarshal(fr.in2p3.jsaga.engine.schema.config.Protocol.class, reader);
553     } //-- java.lang.Object unmarshal(java.io.Reader) 
554 
555     /**
556      * Method validate
557      * 
558      */
559     public void validate()
560         throws org.exolab.castor.xml.ValidationException
561     {
562         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
563         validator.validate(this);
564     } //-- void validate() 
565 
566 }