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