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.descriptors;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import org.exolab.castor.tests.framework.testDescriptor.OnlySourceGenerationTest;
15  
16  /**
17   * Class OnlySourceGenerationTestDescriptor.
18   * 
19   * @version $Revision$ $Date$
20   */
21  public class OnlySourceGenerationTestDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
22  
23  
24        //--------------------------/
25       //- Class/Member Variables -/
26      //--------------------------/
27  
28      /**
29       * Field _elementDefinition.
30       */
31      private boolean _elementDefinition;
32  
33      /**
34       * Field _nsPrefix.
35       */
36      private java.lang.String _nsPrefix;
37  
38      /**
39       * Field _nsURI.
40       */
41      private java.lang.String _nsURI;
42  
43      /**
44       * Field _xmlName.
45       */
46      private java.lang.String _xmlName;
47  
48      /**
49       * Field _identity.
50       */
51      private org.exolab.castor.xml.XMLFieldDescriptor _identity;
52  
53  
54        //----------------/
55       //- Constructors -/
56      //----------------/
57  
58      public OnlySourceGenerationTestDescriptor() {
59          super();
60          _nsURI = "http://castor.exolab.org/Test";
61          _xmlName = "OnlySourceGenerationTest";
62          _elementDefinition = true;
63  
64          //-- set grouping compositor
65          setCompositorAsSequence();
66          org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
67          org.exolab.castor.mapping.FieldHandler             handler        = null;
68          org.exolab.castor.xml.FieldValidator               fieldValidator = null;
69          //-- initialize attribute descriptors
70  
71          //-- initialize element descriptors
72  
73          //-- _schemaList
74          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_schemaList", "Schema", org.exolab.castor.xml.NodeType.Element);
75          desc.setImmutable(true);
76          handler = new org.exolab.castor.xml.XMLFieldHandler() {
77              public java.lang.Object getValue( java.lang.Object object ) 
78                  throws IllegalStateException
79              {
80                  OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
81                  return target.getSchema();
82              }
83              public void setValue( java.lang.Object object, java.lang.Object value) 
84                  throws IllegalStateException, IllegalArgumentException
85              {
86                  try {
87                      OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
88                      target.addSchema( (java.lang.String) value);
89                  } catch (java.lang.Exception ex) {
90                      throw new IllegalStateException(ex.toString());
91                  }
92              }
93              public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
94                  try {
95                      OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
96                      target.removeAllSchema();
97                  } catch (java.lang.Exception ex) {
98                      throw new IllegalStateException(ex.toString());
99                  }
100             }
101             public java.lang.Object newInstance(java.lang.Object parent) {
102                 return null;
103             }
104         };
105         desc.setSchemaType("list");
106         desc.setComponentType("string");
107         desc.setHandler(handler);
108         desc.setNameSpaceURI("http://castor.exolab.org/Test");
109         desc.setRequired(true);
110         desc.setMultivalued(true);
111         addFieldDescriptor(desc);
112         addSequenceElement(desc);
113 
114         //-- validation code for: _schemaList
115         fieldValidator = new org.exolab.castor.xml.FieldValidator();
116         fieldValidator.setMinOccurs(1);
117         { //-- local scope
118             org.exolab.castor.xml.validators.StringValidator typeValidator;
119             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
120             fieldValidator.setValidator(typeValidator);
121             typeValidator.setWhiteSpace("preserve");
122         }
123         desc.setValidator(fieldValidator);
124         //-- _property_File
125         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_property_File", "Property_File", org.exolab.castor.xml.NodeType.Element);
126         desc.setImmutable(true);
127         handler = new org.exolab.castor.xml.XMLFieldHandler() {
128             public java.lang.Object getValue( java.lang.Object object ) 
129                 throws IllegalStateException
130             {
131                 OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
132                 return target.getProperty_File();
133             }
134             public void setValue( java.lang.Object object, java.lang.Object value) 
135                 throws IllegalStateException, IllegalArgumentException
136             {
137                 try {
138                     OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
139                     target.setProperty_File( (java.lang.String) value);
140                 } catch (java.lang.Exception ex) {
141                     throw new IllegalStateException(ex.toString());
142                 }
143             }
144             public java.lang.Object newInstance(java.lang.Object parent) {
145                 return null;
146             }
147         };
148         desc.setSchemaType("string");
149         desc.setHandler(handler);
150         desc.setNameSpaceURI("http://castor.exolab.org/Test");
151         desc.setMultivalued(false);
152         addFieldDescriptor(desc);
153         addSequenceElement(desc);
154 
155         //-- validation code for: _property_File
156         fieldValidator = new org.exolab.castor.xml.FieldValidator();
157         { //-- local scope
158             org.exolab.castor.xml.validators.StringValidator typeValidator;
159             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
160             fieldValidator.setValidator(typeValidator);
161             typeValidator.setWhiteSpace("preserve");
162         }
163         desc.setValidator(fieldValidator);
164         //-- _collection
165         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.tests.framework.testDescriptor.types.CollectionType.class, "_collection", "Collection", org.exolab.castor.xml.NodeType.Element);
166         handler = new org.exolab.castor.xml.XMLFieldHandler() {
167             public java.lang.Object getValue( java.lang.Object object ) 
168                 throws IllegalStateException
169             {
170                 OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
171                 return target.getCollection();
172             }
173             public void setValue( java.lang.Object object, java.lang.Object value) 
174                 throws IllegalStateException, IllegalArgumentException
175             {
176                 try {
177                     OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
178                     target.setCollection( (org.exolab.castor.tests.framework.testDescriptor.types.CollectionType) value);
179                 } catch (java.lang.Exception ex) {
180                     throw new IllegalStateException(ex.toString());
181                 }
182             }
183             public java.lang.Object newInstance(java.lang.Object parent) {
184                 return null;
185             }
186         };
187         handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(org.exolab.castor.tests.framework.testDescriptor.types.CollectionType.class, handler);
188         desc.setImmutable(true);
189         desc.setSchemaType("CollectionType");
190         desc.setHandler(handler);
191         desc.setNameSpaceURI("http://castor.exolab.org/Test");
192         desc.setMultivalued(false);
193         addFieldDescriptor(desc);
194         addSequenceElement(desc);
195 
196         //-- validation code for: _collection
197         fieldValidator = new org.exolab.castor.xml.FieldValidator();
198         { //-- local scope
199         }
200         desc.setValidator(fieldValidator);
201         //-- _bindingFile
202         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_bindingFile", "BindingFile", org.exolab.castor.xml.NodeType.Element);
203         desc.setImmutable(true);
204         handler = new org.exolab.castor.xml.XMLFieldHandler() {
205             public java.lang.Object getValue( java.lang.Object object ) 
206                 throws IllegalStateException
207             {
208                 OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
209                 return target.getBindingFile();
210             }
211             public void setValue( java.lang.Object object, java.lang.Object value) 
212                 throws IllegalStateException, IllegalArgumentException
213             {
214                 try {
215                     OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
216                     target.setBindingFile( (java.lang.String) value);
217                 } catch (java.lang.Exception ex) {
218                     throw new IllegalStateException(ex.toString());
219                 }
220             }
221             public java.lang.Object newInstance(java.lang.Object parent) {
222                 return null;
223             }
224         };
225         desc.setSchemaType("string");
226         desc.setHandler(handler);
227         desc.setNameSpaceURI("http://castor.exolab.org/Test");
228         desc.setMultivalued(false);
229         addFieldDescriptor(desc);
230         addSequenceElement(desc);
231 
232         //-- validation code for: _bindingFile
233         fieldValidator = new org.exolab.castor.xml.FieldValidator();
234         { //-- local scope
235             org.exolab.castor.xml.validators.StringValidator typeValidator;
236             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
237             fieldValidator.setValidator(typeValidator);
238             typeValidator.setWhiteSpace("preserve");
239         }
240         desc.setValidator(fieldValidator);
241         //-- _package
242         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_package", "Package", org.exolab.castor.xml.NodeType.Element);
243         desc.setImmutable(true);
244         handler = new org.exolab.castor.xml.XMLFieldHandler() {
245             public java.lang.Object getValue( java.lang.Object object ) 
246                 throws IllegalStateException
247             {
248                 OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
249                 return target.getPackage();
250             }
251             public void setValue( java.lang.Object object, java.lang.Object value) 
252                 throws IllegalStateException, IllegalArgumentException
253             {
254                 try {
255                     OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
256                     target.setPackage( (java.lang.String) value);
257                 } catch (java.lang.Exception ex) {
258                     throw new IllegalStateException(ex.toString());
259                 }
260             }
261             public java.lang.Object newInstance(java.lang.Object parent) {
262                 return null;
263             }
264         };
265         desc.setSchemaType("string");
266         desc.setHandler(handler);
267         desc.setNameSpaceURI("http://castor.exolab.org/Test");
268         desc.setMultivalued(false);
269         addFieldDescriptor(desc);
270         addSequenceElement(desc);
271 
272         //-- validation code for: _package
273         fieldValidator = new org.exolab.castor.xml.FieldValidator();
274         { //-- local scope
275             org.exolab.castor.xml.validators.StringValidator typeValidator;
276             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
277             fieldValidator.setValidator(typeValidator);
278             typeValidator.setWhiteSpace("preserve");
279         }
280         desc.setValidator(fieldValidator);
281         //-- _unitTestCaseList
282         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.tests.framework.testDescriptor.UnitTestCase.class, "_unitTestCaseList", "UnitTestCase", org.exolab.castor.xml.NodeType.Element);
283         handler = new org.exolab.castor.xml.XMLFieldHandler() {
284             public java.lang.Object getValue( java.lang.Object object ) 
285                 throws IllegalStateException
286             {
287                 OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
288                 return target.getUnitTestCase();
289             }
290             public void setValue( java.lang.Object object, java.lang.Object value) 
291                 throws IllegalStateException, IllegalArgumentException
292             {
293                 try {
294                     OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
295                     target.addUnitTestCase( (org.exolab.castor.tests.framework.testDescriptor.UnitTestCase) value);
296                 } catch (java.lang.Exception ex) {
297                     throw new IllegalStateException(ex.toString());
298                 }
299             }
300             public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
301                 try {
302                     OnlySourceGenerationTest target = (OnlySourceGenerationTest) object;
303                     target.removeAllUnitTestCase();
304                 } catch (java.lang.Exception ex) {
305                     throw new IllegalStateException(ex.toString());
306                 }
307             }
308             public java.lang.Object newInstance(java.lang.Object parent) {
309                 return new org.exolab.castor.tests.framework.testDescriptor.UnitTestCase();
310             }
311         };
312         desc.setSchemaType("list");
313         desc.setComponentType("org.exolab.castor.tests.framework.testDescriptor.UnitTestCase");
314         desc.setHandler(handler);
315         desc.setNameSpaceURI("http://castor.exolab.org/Test");
316         desc.setRequired(true);
317         desc.setMultivalued(true);
318         addFieldDescriptor(desc);
319         addSequenceElement(desc);
320 
321         //-- validation code for: _unitTestCaseList
322         fieldValidator = new org.exolab.castor.xml.FieldValidator();
323         fieldValidator.setMinOccurs(1);
324         { //-- local scope
325         }
326         desc.setValidator(fieldValidator);
327     }
328 
329 
330       //-----------/
331      //- Methods -/
332     //-----------/
333 
334     /**
335      * Method getAccessMode.
336      * 
337      * @return the access mode specified for this class.
338      */
339     public org.exolab.castor.mapping.AccessMode getAccessMode(
340     ) {
341         return null;
342     }
343 
344     /**
345      * Method getIdentity.
346      * 
347      * @return the identity field, null if this class has no
348      * identity.
349      */
350     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
351     ) {
352         return _identity;
353     }
354 
355     /**
356      * Method getJavaClass.
357      * 
358      * @return the Java class represented by this descriptor.
359      */
360     public java.lang.Class getJavaClass(
361     ) {
362         return org.exolab.castor.tests.framework.testDescriptor.OnlySourceGenerationTest.class;
363     }
364 
365     /**
366      * Method getNameSpacePrefix.
367      * 
368      * @return the namespace prefix to use when marshaling as XML.
369      */
370     public java.lang.String getNameSpacePrefix(
371     ) {
372         return _nsPrefix;
373     }
374 
375     /**
376      * Method getNameSpaceURI.
377      * 
378      * @return the namespace URI used when marshaling and
379      * unmarshaling as XML.
380      */
381     public java.lang.String getNameSpaceURI(
382     ) {
383         return _nsURI;
384     }
385 
386     /**
387      * Method getValidator.
388      * 
389      * @return a specific validator for the class described by this
390      * ClassDescriptor.
391      */
392     public org.exolab.castor.xml.TypeValidator getValidator(
393     ) {
394         return this;
395     }
396 
397     /**
398      * Method getXMLName.
399      * 
400      * @return the XML Name for the Class being described.
401      */
402     public java.lang.String getXMLName(
403     ) {
404         return _xmlName;
405     }
406 
407     /**
408      * Method isElementDefinition.
409      * 
410      * @return true if XML schema definition of this Class is that
411      * of a global
412      * element or element with anonymous type definition.
413      */
414     public boolean isElementDefinition(
415     ) {
416         return _elementDefinition;
417     }
418 
419 }