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