View Javadoc
1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package org.exolab.castor.tests.framework.testDescriptor;
9   
10  /**
11   * Configuration for marshaling or unmarshaling or source
12   * generation. Contains
13   *  a list of methods to be called on the marshaler or unmarshaler
14   * or source
15   *  generator with the parameters to be provided for each method.
16   *  
17   * 
18   * @version $Revision$ $Date$
19   */
20  public class ConfigurationType implements java.io.Serializable {
21  
22  
23        //--------------------------/
24       //- Class/Member Variables -/
25      //--------------------------/
26  
27      /**
28       * A single method to call
29       *  
30       */
31      private java.util.List _callMethodList;
32  
33  
34        //----------------/
35       //- Constructors -/
36      //----------------/
37  
38      public ConfigurationType() {
39          super();
40          this._callMethodList = new java.util.ArrayList();
41      }
42  
43  
44        //-----------/
45       //- Methods -/
46      //-----------/
47  
48      /**
49       * 
50       * 
51       * @param vCallMethod
52       * @throws java.lang.IndexOutOfBoundsException if the index
53       * given is outside the bounds of the collection
54       */
55      public void addCallMethod(
56              final org.exolab.castor.tests.framework.testDescriptor.CallMethod vCallMethod)
57      throws java.lang.IndexOutOfBoundsException {
58          this._callMethodList.add(vCallMethod);
59      }
60  
61      /**
62       * 
63       * 
64       * @param index
65       * @param vCallMethod
66       * @throws java.lang.IndexOutOfBoundsException if the index
67       * given is outside the bounds of the collection
68       */
69      public void addCallMethod(
70              final int index,
71              final org.exolab.castor.tests.framework.testDescriptor.CallMethod vCallMethod)
72      throws java.lang.IndexOutOfBoundsException {
73          this._callMethodList.add(index, vCallMethod);
74      }
75  
76      /**
77       * Method enumerateCallMethod.
78       * 
79       * @return an Enumeration over all possible elements of this
80       * collection
81       */
82      public java.util.Enumeration enumerateCallMethod(
83      ) {
84          return java.util.Collections.enumeration(this._callMethodList);
85      }
86  
87      /**
88       * Method getCallMethod.
89       * 
90       * @param index
91       * @throws java.lang.IndexOutOfBoundsException if the index
92       * given is outside the bounds of the collection
93       * @return the value of the
94       * org.exolab.castor.tests.framework.testDescriptor.CallMethod
95       * at the given index
96       */
97      public org.exolab.castor.tests.framework.testDescriptor.CallMethod getCallMethod(
98              final int index)
99      throws java.lang.IndexOutOfBoundsException {
100         // check bounds for index
101         if (index < 0 || index >= this._callMethodList.size()) {
102             throw new IndexOutOfBoundsException("getCallMethod: Index value '" + index + "' not in range [0.." + (this._callMethodList.size() - 1) + "]");
103         }
104 
105         return (org.exolab.castor.tests.framework.testDescriptor.CallMethod) _callMethodList.get(index);
106     }
107 
108     /**
109      * Method getCallMethod.Returns the contents of the collection
110      * in an Array.  <p>Note:  Just in case the collection contents
111      * are changing in another thread, we pass a 0-length Array of
112      * the correct type into the API call.  This way we <i>know</i>
113      * that the Array returned is of exactly the correct length.
114      * 
115      * @return this collection as an Array
116      */
117     public org.exolab.castor.tests.framework.testDescriptor.CallMethod[] getCallMethod(
118     ) {
119         org.exolab.castor.tests.framework.testDescriptor.CallMethod[] array = new org.exolab.castor.tests.framework.testDescriptor.CallMethod[0];
120         return (org.exolab.castor.tests.framework.testDescriptor.CallMethod[]) this._callMethodList.toArray(array);
121     }
122 
123     /**
124      * Method getCallMethodCount.
125      * 
126      * @return the size of this collection
127      */
128     public int getCallMethodCount(
129     ) {
130         return this._callMethodList.size();
131     }
132 
133     /**
134      * Method isValid.
135      * 
136      * @return true if this object is valid according to the schema
137      */
138     public boolean isValid(
139     ) {
140         try {
141             validate();
142         } catch (org.exolab.castor.xml.ValidationException vex) {
143             return false;
144         }
145         return true;
146     }
147 
148     /**
149      * Method iterateCallMethod.
150      * 
151      * @return an Iterator over all possible elements in this
152      * collection
153      */
154     public java.util.Iterator iterateCallMethod(
155     ) {
156         return this._callMethodList.iterator();
157     }
158 
159     /**
160      * 
161      * 
162      * @param out
163      * @throws org.exolab.castor.xml.MarshalException if object is
164      * null or if any SAXException is thrown during marshaling
165      * @throws org.exolab.castor.xml.ValidationException if this
166      * object is an invalid instance according to the schema
167      */
168     public void marshal(
169             final java.io.Writer out)
170     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
171         org.exolab.castor.xml.Marshaller.marshal(this, out);
172     }
173 
174     /**
175      * 
176      * 
177      * @param handler
178      * @throws java.io.IOException if an IOException occurs during
179      * marshaling
180      * @throws org.exolab.castor.xml.ValidationException if this
181      * object is an invalid instance according to the schema
182      * @throws org.exolab.castor.xml.MarshalException if object is
183      * null or if any SAXException is thrown during marshaling
184      */
185     public void marshal(
186             final org.xml.sax.ContentHandler handler)
187     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
188         org.exolab.castor.xml.Marshaller.marshal(this, handler);
189     }
190 
191     /**
192      */
193     public void removeAllCallMethod(
194     ) {
195         this._callMethodList.clear();
196     }
197 
198     /**
199      * Method removeCallMethod.
200      * 
201      * @param vCallMethod
202      * @return true if the object was removed from the collection.
203      */
204     public boolean removeCallMethod(
205             final org.exolab.castor.tests.framework.testDescriptor.CallMethod vCallMethod) {
206         boolean removed = _callMethodList.remove(vCallMethod);
207         return removed;
208     }
209 
210     /**
211      * Method removeCallMethodAt.
212      * 
213      * @param index
214      * @return the element removed from the collection
215      */
216     public org.exolab.castor.tests.framework.testDescriptor.CallMethod removeCallMethodAt(
217             final int index) {
218         java.lang.Object obj = this._callMethodList.remove(index);
219         return (org.exolab.castor.tests.framework.testDescriptor.CallMethod) obj;
220     }
221 
222     /**
223      * 
224      * 
225      * @param index
226      * @param vCallMethod
227      * @throws java.lang.IndexOutOfBoundsException if the index
228      * given is outside the bounds of the collection
229      */
230     public void setCallMethod(
231             final int index,
232             final org.exolab.castor.tests.framework.testDescriptor.CallMethod vCallMethod)
233     throws java.lang.IndexOutOfBoundsException {
234         // check bounds for index
235         if (index < 0 || index >= this._callMethodList.size()) {
236             throw new IndexOutOfBoundsException("setCallMethod: Index value '" + index + "' not in range [0.." + (this._callMethodList.size() - 1) + "]");
237         }
238 
239         this._callMethodList.set(index, vCallMethod);
240     }
241 
242     /**
243      * 
244      * 
245      * @param vCallMethodArray
246      */
247     public void setCallMethod(
248             final org.exolab.castor.tests.framework.testDescriptor.CallMethod[] vCallMethodArray) {
249         //-- copy array
250         _callMethodList.clear();
251 
252         for (int i = 0; i < vCallMethodArray.length; i++) {
253                 this._callMethodList.add(vCallMethodArray[i]);
254         }
255     }
256 
257     /**
258      * Method unmarshal.
259      * 
260      * @param reader
261      * @throws org.exolab.castor.xml.MarshalException if object is
262      * null or if any SAXException is thrown during marshaling
263      * @throws org.exolab.castor.xml.ValidationException if this
264      * object is an invalid instance according to the schema
265      * @return the unmarshaled
266      * org.exolab.castor.tests.framework.testDescriptor.ConfigurationType
267      */
268     public static org.exolab.castor.tests.framework.testDescriptor.ConfigurationType unmarshal(
269             final java.io.Reader reader)
270     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
271         return (org.exolab.castor.tests.framework.testDescriptor.ConfigurationType) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.ConfigurationType.class, reader);
272     }
273 
274     /**
275      * 
276      * 
277      * @throws org.exolab.castor.xml.ValidationException if this
278      * object is an invalid instance according to the schema
279      */
280     public void validate(
281     )
282     throws org.exolab.castor.xml.ValidationException {
283         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
284         validator.validate(this);
285     }
286 
287 }