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.TestDescriptorChoice;
15  
16  /**
17   * Class TestDescriptorChoiceDescriptor.
18   * 
19   * @version $Revision$ $Date$
20   */
21  public class TestDescriptorChoiceDescriptor 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 TestDescriptorChoiceDescriptor() {
59          super();
60          _nsURI = "http://castor.exolab.org/Test";
61          _elementDefinition = false;
62  
63          //-- set grouping compositor
64          setCompositorAsChoice();
65          org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
66          org.exolab.castor.mapping.FieldHandler             handler        = null;
67          org.exolab.castor.xml.FieldValidator               fieldValidator = null;
68          //-- initialize attribute descriptors
69  
70          //-- initialize element descriptors
71  
72          //-- _sourceGeneratorTest
73          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.tests.framework.testDescriptor.SourceGeneratorTest.class, "_sourceGeneratorTest", "SourceGeneratorTest", org.exolab.castor.xml.NodeType.Element);
74          handler = new org.exolab.castor.xml.XMLFieldHandler() {
75              public java.lang.Object getValue( java.lang.Object object ) 
76                  throws IllegalStateException
77              {
78                  TestDescriptorChoice target = (TestDescriptorChoice) object;
79                  return target.getSourceGeneratorTest();
80              }
81              public void setValue( java.lang.Object object, java.lang.Object value) 
82                  throws IllegalStateException, IllegalArgumentException
83              {
84                  try {
85                      TestDescriptorChoice target = (TestDescriptorChoice) object;
86                      target.setSourceGeneratorTest( (org.exolab.castor.tests.framework.testDescriptor.SourceGeneratorTest) value);
87                  } catch (java.lang.Exception ex) {
88                      throw new IllegalStateException(ex.toString());
89                  }
90              }
91              public java.lang.Object newInstance(java.lang.Object parent) {
92                  return new org.exolab.castor.tests.framework.testDescriptor.SourceGeneratorTest();
93              }
94          };
95          desc.setSchemaType("org.exolab.castor.tests.framework.testDescriptor.SourceGeneratorTest");
96          desc.setHandler(handler);
97          desc.setNameSpaceURI("http://castor.exolab.org/Test");
98          desc.setMultivalued(false);
99          addFieldDescriptor(desc);
100         addSequenceElement(desc);
101 
102         //-- validation code for: _sourceGeneratorTest
103         fieldValidator = new org.exolab.castor.xml.FieldValidator();
104         { //-- local scope
105         }
106         desc.setValidator(fieldValidator);
107         //-- _marshallingTest
108         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.tests.framework.testDescriptor.MarshallingTest.class, "_marshallingTest", "MarshallingTest", org.exolab.castor.xml.NodeType.Element);
109         handler = new org.exolab.castor.xml.XMLFieldHandler() {
110             public java.lang.Object getValue( java.lang.Object object ) 
111                 throws IllegalStateException
112             {
113                 TestDescriptorChoice target = (TestDescriptorChoice) object;
114                 return target.getMarshallingTest();
115             }
116             public void setValue( java.lang.Object object, java.lang.Object value) 
117                 throws IllegalStateException, IllegalArgumentException
118             {
119                 try {
120                     TestDescriptorChoice target = (TestDescriptorChoice) object;
121                     target.setMarshallingTest( (org.exolab.castor.tests.framework.testDescriptor.MarshallingTest) value);
122                 } catch (java.lang.Exception ex) {
123                     throw new IllegalStateException(ex.toString());
124                 }
125             }
126             public java.lang.Object newInstance(java.lang.Object parent) {
127                 return new org.exolab.castor.tests.framework.testDescriptor.MarshallingTest();
128             }
129         };
130         desc.setSchemaType("org.exolab.castor.tests.framework.testDescriptor.MarshallingTest");
131         desc.setHandler(handler);
132         desc.setNameSpaceURI("http://castor.exolab.org/Test");
133         desc.setMultivalued(false);
134         addFieldDescriptor(desc);
135         addSequenceElement(desc);
136 
137         //-- validation code for: _marshallingTest
138         fieldValidator = new org.exolab.castor.xml.FieldValidator();
139         { //-- local scope
140         }
141         desc.setValidator(fieldValidator);
142         //-- _schemaTest
143         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.tests.framework.testDescriptor.SchemaTest.class, "_schemaTest", "SchemaTest", org.exolab.castor.xml.NodeType.Element);
144         handler = new org.exolab.castor.xml.XMLFieldHandler() {
145             public java.lang.Object getValue( java.lang.Object object ) 
146                 throws IllegalStateException
147             {
148                 TestDescriptorChoice target = (TestDescriptorChoice) object;
149                 return target.getSchemaTest();
150             }
151             public void setValue( java.lang.Object object, java.lang.Object value) 
152                 throws IllegalStateException, IllegalArgumentException
153             {
154                 try {
155                     TestDescriptorChoice target = (TestDescriptorChoice) object;
156                     target.setSchemaTest( (org.exolab.castor.tests.framework.testDescriptor.SchemaTest) value);
157                 } catch (java.lang.Exception ex) {
158                     throw new IllegalStateException(ex.toString());
159                 }
160             }
161             public java.lang.Object newInstance(java.lang.Object parent) {
162                 return new org.exolab.castor.tests.framework.testDescriptor.SchemaTest();
163             }
164         };
165         desc.setSchemaType("org.exolab.castor.tests.framework.testDescriptor.SchemaTest");
166         desc.setHandler(handler);
167         desc.setNameSpaceURI("http://castor.exolab.org/Test");
168         desc.setMultivalued(false);
169         addFieldDescriptor(desc);
170         addSequenceElement(desc);
171 
172         //-- validation code for: _schemaTest
173         fieldValidator = new org.exolab.castor.xml.FieldValidator();
174         { //-- local scope
175         }
176         desc.setValidator(fieldValidator);
177         //-- _onlySourceGenerationTest
178         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.tests.framework.testDescriptor.OnlySourceGenerationTest.class, "_onlySourceGenerationTest", "OnlySourceGenerationTest", org.exolab.castor.xml.NodeType.Element);
179         handler = new org.exolab.castor.xml.XMLFieldHandler() {
180             public java.lang.Object getValue( java.lang.Object object ) 
181                 throws IllegalStateException
182             {
183                 TestDescriptorChoice target = (TestDescriptorChoice) object;
184                 return target.getOnlySourceGenerationTest();
185             }
186             public void setValue( java.lang.Object object, java.lang.Object value) 
187                 throws IllegalStateException, IllegalArgumentException
188             {
189                 try {
190                     TestDescriptorChoice target = (TestDescriptorChoice) object;
191                     target.setOnlySourceGenerationTest( (org.exolab.castor.tests.framework.testDescriptor.OnlySourceGenerationTest) value);
192                 } catch (java.lang.Exception ex) {
193                     throw new IllegalStateException(ex.toString());
194                 }
195             }
196             public java.lang.Object newInstance(java.lang.Object parent) {
197                 return new org.exolab.castor.tests.framework.testDescriptor.OnlySourceGenerationTest();
198             }
199         };
200         desc.setSchemaType("org.exolab.castor.tests.framework.testDescriptor.OnlySourceGenerationTest");
201         desc.setHandler(handler);
202         desc.setNameSpaceURI("http://castor.exolab.org/Test");
203         desc.setMultivalued(false);
204         addFieldDescriptor(desc);
205         addSequenceElement(desc);
206 
207         //-- validation code for: _onlySourceGenerationTest
208         fieldValidator = new org.exolab.castor.xml.FieldValidator();
209         { //-- local scope
210         }
211         desc.setValidator(fieldValidator);
212     }
213 
214 
215       //-----------/
216      //- Methods -/
217     //-----------/
218 
219     /**
220      * Method getAccessMode.
221      * 
222      * @return the access mode specified for this class.
223      */
224     public org.exolab.castor.mapping.AccessMode getAccessMode(
225     ) {
226         return null;
227     }
228 
229     /**
230      * Method getIdentity.
231      * 
232      * @return the identity field, null if this class has no
233      * identity.
234      */
235     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
236     ) {
237         return _identity;
238     }
239 
240     /**
241      * Method getJavaClass.
242      * 
243      * @return the Java class represented by this descriptor.
244      */
245     public java.lang.Class getJavaClass(
246     ) {
247         return org.exolab.castor.tests.framework.testDescriptor.TestDescriptorChoice.class;
248     }
249 
250     /**
251      * Method getNameSpacePrefix.
252      * 
253      * @return the namespace prefix to use when marshaling as XML.
254      */
255     public java.lang.String getNameSpacePrefix(
256     ) {
257         return _nsPrefix;
258     }
259 
260     /**
261      * Method getNameSpaceURI.
262      * 
263      * @return the namespace URI used when marshaling and
264      * unmarshaling as XML.
265      */
266     public java.lang.String getNameSpaceURI(
267     ) {
268         return _nsURI;
269     }
270 
271     /**
272      * Method getValidator.
273      * 
274      * @return a specific validator for the class described by this
275      * ClassDescriptor.
276      */
277     public org.exolab.castor.xml.TypeValidator getValidator(
278     ) {
279         return this;
280     }
281 
282     /**
283      * Method getXMLName.
284      * 
285      * @return the XML Name for the Class being described.
286      */
287     public java.lang.String getXMLName(
288     ) {
289         return _xmlName;
290     }
291 
292     /**
293      * Method isElementDefinition.
294      * 
295      * @return true if XML schema definition of this Class is that
296      * of a global
297      * element or element with anonymous type definition.
298      */
299     public boolean isElementDefinition(
300     ) {
301         return _elementDefinition;
302     }
303 
304 }