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.SourceGeneratorTest;
15  
16  /**
17   * Class SourceGeneratorTestDescriptor.
18   * 
19   * @version $Revision$ $Date$
20   */
21  public class SourceGeneratorTestDescriptor 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 SourceGeneratorTestDescriptor() {
59          super();
60          _nsURI = "http://castor.exolab.org/Test";
61          _xmlName = "SourceGeneratorTest";
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                  SourceGeneratorTest target = (SourceGeneratorTest) 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                      SourceGeneratorTest target = (SourceGeneratorTest) 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                      SourceGeneratorTest target = (SourceGeneratorTest) 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                 SourceGeneratorTest target = (SourceGeneratorTest) 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                     SourceGeneratorTest target = (SourceGeneratorTest) 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                 SourceGeneratorTest target = (SourceGeneratorTest) 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                     SourceGeneratorTest target = (SourceGeneratorTest) 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                 SourceGeneratorTest target = (SourceGeneratorTest) 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                     SourceGeneratorTest target = (SourceGeneratorTest) 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                 SourceGeneratorTest target = (SourceGeneratorTest) 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                     SourceGeneratorTest target = (SourceGeneratorTest) 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         //-- _root_Object
282         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.tests.framework.testDescriptor.Root_Object.class, "_root_Object", "Root_Object", 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                 SourceGeneratorTest target = (SourceGeneratorTest) object;
288                 return target.getRoot_Object();
289             }
290             public void setValue( java.lang.Object object, java.lang.Object value) 
291                 throws IllegalStateException, IllegalArgumentException
292             {
293                 try {
294                     SourceGeneratorTest target = (SourceGeneratorTest) object;
295                     target.setRoot_Object( (org.exolab.castor.tests.framework.testDescriptor.Root_Object) value);
296                 } catch (java.lang.Exception ex) {
297                     throw new IllegalStateException(ex.toString());
298                 }
299             }
300             public java.lang.Object newInstance(java.lang.Object parent) {
301                 return new org.exolab.castor.tests.framework.testDescriptor.Root_Object();
302             }
303         };
304         desc.setSchemaType("org.exolab.castor.tests.framework.testDescriptor.Root_Object");
305         desc.setHandler(handler);
306         desc.setNameSpaceURI("http://castor.exolab.org/Test");
307         desc.setRequired(true);
308         desc.setMultivalued(false);
309         addFieldDescriptor(desc);
310         addSequenceElement(desc);
311 
312         //-- validation code for: _root_Object
313         fieldValidator = new org.exolab.castor.xml.FieldValidator();
314         fieldValidator.setMinOccurs(1);
315         { //-- local scope
316         }
317         desc.setValidator(fieldValidator);
318         //-- _expectedSources
319         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.tests.framework.testDescriptor.ExpectedSources.class, "_expectedSources", "expectedSources", org.exolab.castor.xml.NodeType.Element);
320         handler = new org.exolab.castor.xml.XMLFieldHandler() {
321             public java.lang.Object getValue( java.lang.Object object ) 
322                 throws IllegalStateException
323             {
324                 SourceGeneratorTest target = (SourceGeneratorTest) object;
325                 return target.getExpectedSources();
326             }
327             public void setValue( java.lang.Object object, java.lang.Object value) 
328                 throws IllegalStateException, IllegalArgumentException
329             {
330                 try {
331                     SourceGeneratorTest target = (SourceGeneratorTest) object;
332                     target.setExpectedSources( (org.exolab.castor.tests.framework.testDescriptor.ExpectedSources) value);
333                 } catch (java.lang.Exception ex) {
334                     throw new IllegalStateException(ex.toString());
335                 }
336             }
337             public java.lang.Object newInstance(java.lang.Object parent) {
338                 return new org.exolab.castor.tests.framework.testDescriptor.ExpectedSources();
339             }
340         };
341         desc.setSchemaType("org.exolab.castor.tests.framework.testDescriptor.ExpectedSources");
342         desc.setHandler(handler);
343         desc.setNameSpaceURI("http://castor.exolab.org/Test");
344         desc.setMultivalued(false);
345         addFieldDescriptor(desc);
346         addSequenceElement(desc);
347 
348         //-- validation code for: _expectedSources
349         fieldValidator = new org.exolab.castor.xml.FieldValidator();
350         { //-- local scope
351         }
352         desc.setValidator(fieldValidator);
353         //-- _sourcesNotExpected
354         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.tests.framework.testDescriptor.SourcesNotExpected.class, "_sourcesNotExpected", "sourcesNotExpected", org.exolab.castor.xml.NodeType.Element);
355         handler = new org.exolab.castor.xml.XMLFieldHandler() {
356             public java.lang.Object getValue( java.lang.Object object ) 
357                 throws IllegalStateException
358             {
359                 SourceGeneratorTest target = (SourceGeneratorTest) object;
360                 return target.getSourcesNotExpected();
361             }
362             public void setValue( java.lang.Object object, java.lang.Object value) 
363                 throws IllegalStateException, IllegalArgumentException
364             {
365                 try {
366                     SourceGeneratorTest target = (SourceGeneratorTest) object;
367                     target.setSourcesNotExpected( (org.exolab.castor.tests.framework.testDescriptor.SourcesNotExpected) value);
368                 } catch (java.lang.Exception ex) {
369                     throw new IllegalStateException(ex.toString());
370                 }
371             }
372             public java.lang.Object newInstance(java.lang.Object parent) {
373                 return new org.exolab.castor.tests.framework.testDescriptor.SourcesNotExpected();
374             }
375         };
376         desc.setSchemaType("org.exolab.castor.tests.framework.testDescriptor.SourcesNotExpected");
377         desc.setHandler(handler);
378         desc.setNameSpaceURI("http://castor.exolab.org/Test");
379         desc.setMultivalued(false);
380         addFieldDescriptor(desc);
381         addSequenceElement(desc);
382 
383         //-- validation code for: _sourcesNotExpected
384         fieldValidator = new org.exolab.castor.xml.FieldValidator();
385         { //-- local scope
386         }
387         desc.setValidator(fieldValidator);
388         //-- _unitTestCaseList
389         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.tests.framework.testDescriptor.UnitTestCase.class, "_unitTestCaseList", "UnitTestCase", org.exolab.castor.xml.NodeType.Element);
390         handler = new org.exolab.castor.xml.XMLFieldHandler() {
391             public java.lang.Object getValue( java.lang.Object object ) 
392                 throws IllegalStateException
393             {
394                 SourceGeneratorTest target = (SourceGeneratorTest) object;
395                 return target.getUnitTestCase();
396             }
397             public void setValue( java.lang.Object object, java.lang.Object value) 
398                 throws IllegalStateException, IllegalArgumentException
399             {
400                 try {
401                     SourceGeneratorTest target = (SourceGeneratorTest) object;
402                     target.addUnitTestCase( (org.exolab.castor.tests.framework.testDescriptor.UnitTestCase) value);
403                 } catch (java.lang.Exception ex) {
404                     throw new IllegalStateException(ex.toString());
405                 }
406             }
407             public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
408                 try {
409                     SourceGeneratorTest target = (SourceGeneratorTest) object;
410                     target.removeAllUnitTestCase();
411                 } catch (java.lang.Exception ex) {
412                     throw new IllegalStateException(ex.toString());
413                 }
414             }
415             public java.lang.Object newInstance(java.lang.Object parent) {
416                 return new org.exolab.castor.tests.framework.testDescriptor.UnitTestCase();
417             }
418         };
419         desc.setSchemaType("list");
420         desc.setComponentType("org.exolab.castor.tests.framework.testDescriptor.UnitTestCase");
421         desc.setHandler(handler);
422         desc.setNameSpaceURI("http://castor.exolab.org/Test");
423         desc.setRequired(true);
424         desc.setMultivalued(true);
425         addFieldDescriptor(desc);
426         addSequenceElement(desc);
427 
428         //-- validation code for: _unitTestCaseList
429         fieldValidator = new org.exolab.castor.xml.FieldValidator();
430         fieldValidator.setMinOccurs(1);
431         { //-- local scope
432         }
433         desc.setValidator(fieldValidator);
434     }
435 
436 
437       //-----------/
438      //- Methods -/
439     //-----------/
440 
441     /**
442      * Method getAccessMode.
443      * 
444      * @return the access mode specified for this class.
445      */
446     public org.exolab.castor.mapping.AccessMode getAccessMode(
447     ) {
448         return null;
449     }
450 
451     /**
452      * Method getIdentity.
453      * 
454      * @return the identity field, null if this class has no
455      * identity.
456      */
457     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
458     ) {
459         return _identity;
460     }
461 
462     /**
463      * Method getJavaClass.
464      * 
465      * @return the Java class represented by this descriptor.
466      */
467     public java.lang.Class getJavaClass(
468     ) {
469         return org.exolab.castor.tests.framework.testDescriptor.SourceGeneratorTest.class;
470     }
471 
472     /**
473      * Method getNameSpacePrefix.
474      * 
475      * @return the namespace prefix to use when marshaling as XML.
476      */
477     public java.lang.String getNameSpacePrefix(
478     ) {
479         return _nsPrefix;
480     }
481 
482     /**
483      * Method getNameSpaceURI.
484      * 
485      * @return the namespace URI used when marshaling and
486      * unmarshaling as XML.
487      */
488     public java.lang.String getNameSpaceURI(
489     ) {
490         return _nsURI;
491     }
492 
493     /**
494      * Method getValidator.
495      * 
496      * @return a specific validator for the class described by this
497      * ClassDescriptor.
498      */
499     public org.exolab.castor.xml.TypeValidator getValidator(
500     ) {
501         return this;
502     }
503 
504     /**
505      * Method getXMLName.
506      * 
507      * @return the XML Name for the Class being described.
508      */
509     public java.lang.String getXMLName(
510     ) {
511         return _xmlName;
512     }
513 
514     /**
515      * Method isElementDefinition.
516      * 
517      * @return true if XML schema definition of this Class is that
518      * of a global
519      * element or element with anonymous type definition.
520      */
521     public boolean isElementDefinition(
522     ) {
523         return _elementDefinition;
524     }
525 
526 }