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.generated.session;
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 ConfigurableType.
28   * 
29   * @version $Revision$ $Date$
30   */
31  public class ConfigurableType implements java.io.Serializable {
32  
33  
34        //--------------------------/
35       //- Class/Member Variables -/
36      //--------------------------/
37  
38      /**
39       * Field _type
40       */
41      private java.lang.String _type;
42  
43      /**
44       * Field _attributeList
45       */
46      private java.util.ArrayList _attributeList;
47  
48  
49        //----------------/
50       //- Constructors -/
51      //----------------/
52  
53      public ConfigurableType() 
54       {
55          super();
56          _attributeList = new ArrayList();
57      } //-- fr.in2p3.jsaga.generated.session.ConfigurableType()
58  
59  
60        //-----------/
61       //- Methods -/
62      //-----------/
63  
64      /**
65       * Method addAttribute
66       * 
67       * 
68       * 
69       * @param vAttribute
70       */
71      public void addAttribute(fr.in2p3.jsaga.generated.session.Attribute vAttribute)
72          throws java.lang.IndexOutOfBoundsException
73      {
74          _attributeList.add(vAttribute);
75      } //-- void addAttribute(fr.in2p3.jsaga.generated.session.Attribute) 
76  
77      /**
78       * Method addAttribute
79       * 
80       * 
81       * 
82       * @param index
83       * @param vAttribute
84       */
85      public void addAttribute(int index, fr.in2p3.jsaga.generated.session.Attribute vAttribute)
86          throws java.lang.IndexOutOfBoundsException
87      {
88          _attributeList.add(index, vAttribute);
89      } //-- void addAttribute(int, fr.in2p3.jsaga.generated.session.Attribute) 
90  
91      /**
92       * Method clearAttribute
93       * 
94       */
95      public void clearAttribute()
96      {
97          _attributeList.clear();
98      } //-- void clearAttribute() 
99  
100     /**
101      * Method enumerateAttribute
102      * 
103      * 
104      * 
105      * @return Enumeration
106      */
107     public java.util.Enumeration enumerateAttribute()
108     {
109         return new org.exolab.castor.util.IteratorEnumeration(_attributeList.iterator());
110     } //-- java.util.Enumeration enumerateAttribute() 
111 
112     /**
113      * Method getAttribute
114      * 
115      * 
116      * 
117      * @param index
118      * @return Attribute
119      */
120     public fr.in2p3.jsaga.generated.session.Attribute getAttribute(int index)
121         throws java.lang.IndexOutOfBoundsException
122     {
123         //-- check bounds for index
124         if ((index < 0) || (index > _attributeList.size())) {
125             throw new IndexOutOfBoundsException();
126         }
127         
128         return (fr.in2p3.jsaga.generated.session.Attribute) _attributeList.get(index);
129     } //-- fr.in2p3.jsaga.generated.session.Attribute getAttribute(int) 
130 
131     /**
132      * Method getAttribute
133      * 
134      * 
135      * 
136      * @return Attribute
137      */
138     public fr.in2p3.jsaga.generated.session.Attribute[] getAttribute()
139     {
140         int size = _attributeList.size();
141         fr.in2p3.jsaga.generated.session.Attribute[] mArray = new fr.in2p3.jsaga.generated.session.Attribute[size];
142         for (int index = 0; index < size; index++) {
143             mArray[index] = (fr.in2p3.jsaga.generated.session.Attribute) _attributeList.get(index);
144         }
145         return mArray;
146     } //-- fr.in2p3.jsaga.generated.session.Attribute[] getAttribute() 
147 
148     /**
149      * Method getAttributeCount
150      * 
151      * 
152      * 
153      * @return int
154      */
155     public int getAttributeCount()
156     {
157         return _attributeList.size();
158     } //-- int getAttributeCount() 
159 
160     /**
161      * Returns the value of field 'type'.
162      * 
163      * @return String
164      * @return the value of field 'type'.
165      */
166     public java.lang.String getType()
167     {
168         return this._type;
169     } //-- java.lang.String getType() 
170 
171     /**
172      * Method isValid
173      * 
174      * 
175      * 
176      * @return boolean
177      */
178     public boolean isValid()
179     {
180         try {
181             validate();
182         }
183         catch (org.exolab.castor.xml.ValidationException vex) {
184             return false;
185         }
186         return true;
187     } //-- boolean isValid() 
188 
189     /**
190      * Method marshal
191      * 
192      * 
193      * 
194      * @param out
195      */
196     public void marshal(java.io.Writer out)
197         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
198     {
199         
200         Marshaller.marshal(this, out);
201     } //-- void marshal(java.io.Writer) 
202 
203     /**
204      * Method marshal
205      * 
206      * 
207      * 
208      * @param handler
209      */
210     public void marshal(org.xml.sax.ContentHandler handler)
211         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
212     {
213         
214         Marshaller.marshal(this, handler);
215     } //-- void marshal(org.xml.sax.ContentHandler) 
216 
217     /**
218      * Method removeAttribute
219      * 
220      * 
221      * 
222      * @param vAttribute
223      * @return boolean
224      */
225     public boolean removeAttribute(fr.in2p3.jsaga.generated.session.Attribute vAttribute)
226     {
227         boolean removed = _attributeList.remove(vAttribute);
228         return removed;
229     } //-- boolean removeAttribute(fr.in2p3.jsaga.generated.session.Attribute) 
230 
231     /**
232      * Method setAttribute
233      * 
234      * 
235      * 
236      * @param index
237      * @param vAttribute
238      */
239     public void setAttribute(int index, fr.in2p3.jsaga.generated.session.Attribute vAttribute)
240         throws java.lang.IndexOutOfBoundsException
241     {
242         //-- check bounds for index
243         if ((index < 0) || (index > _attributeList.size())) {
244             throw new IndexOutOfBoundsException();
245         }
246         _attributeList.set(index, vAttribute);
247     } //-- void setAttribute(int, fr.in2p3.jsaga.generated.session.Attribute) 
248 
249     /**
250      * Method setAttribute
251      * 
252      * 
253      * 
254      * @param attributeArray
255      */
256     public void setAttribute(fr.in2p3.jsaga.generated.session.Attribute[] attributeArray)
257     {
258         //-- copy array
259         _attributeList.clear();
260         for (int i = 0; i < attributeArray.length; i++) {
261             _attributeList.add(attributeArray[i]);
262         }
263     } //-- void setAttribute(fr.in2p3.jsaga.generated.session.Attribute) 
264 
265     /**
266      * Sets the value of field 'type'.
267      * 
268      * @param type the value of field 'type'.
269      */
270     public void setType(java.lang.String type)
271     {
272         this._type = type;
273     } //-- void setType(java.lang.String) 
274 
275     /**
276      * Method unmarshal
277      * 
278      * 
279      * 
280      * @param reader
281      * @return Object
282      */
283     public static java.lang.Object unmarshal(java.io.Reader reader)
284         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
285     {
286         return (fr.in2p3.jsaga.generated.session.ConfigurableType) Unmarshaller.unmarshal(fr.in2p3.jsaga.generated.session.ConfigurableType.class, reader);
287     } //-- java.lang.Object unmarshal(java.io.Reader) 
288 
289     /**
290      * Method validate
291      * 
292      */
293     public void validate()
294         throws org.exolab.castor.xml.ValidationException
295     {
296         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
297         validator.validate(this);
298     } //-- void validate() 
299 
300 }