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.UnitTestCaseChoice;
15  
16  /**
17   * Class UnitTestCaseChoiceDescriptor.
18   * 
19   * @version $Revision$ $Date$
20   */
21  public class UnitTestCaseChoiceDescriptor 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 UnitTestCaseChoiceDescriptor() {
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          //-- _mapping_File
73          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_mapping_File", "Mapping_File", org.exolab.castor.xml.NodeType.Element);
74          desc.setImmutable(true);
75          handler = new org.exolab.castor.xml.XMLFieldHandler() {
76              public java.lang.Object getValue( java.lang.Object object ) 
77                  throws IllegalStateException
78              {
79                  UnitTestCaseChoice target = (UnitTestCaseChoice) object;
80                  return target.getMapping_File();
81              }
82              public void setValue( java.lang.Object object, java.lang.Object value) 
83                  throws IllegalStateException, IllegalArgumentException
84              {
85                  try {
86                      UnitTestCaseChoice target = (UnitTestCaseChoice) object;
87                      target.setMapping_File( (java.lang.String) 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 null;
94              }
95          };
96          desc.setSchemaType("string");
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: _mapping_File
104         fieldValidator = new org.exolab.castor.xml.FieldValidator();
105         { //-- local scope
106             org.exolab.castor.xml.validators.StringValidator typeValidator;
107             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
108             fieldValidator.setValidator(typeValidator);
109             typeValidator.setWhiteSpace("preserve");
110         }
111         desc.setValidator(fieldValidator);
112         //-- _schema
113         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_schema", "Schema", org.exolab.castor.xml.NodeType.Element);
114         desc.setImmutable(true);
115         handler = new org.exolab.castor.xml.XMLFieldHandler() {
116             public java.lang.Object getValue( java.lang.Object object ) 
117                 throws IllegalStateException
118             {
119                 UnitTestCaseChoice target = (UnitTestCaseChoice) object;
120                 return target.getSchema();
121             }
122             public void setValue( java.lang.Object object, java.lang.Object value) 
123                 throws IllegalStateException, IllegalArgumentException
124             {
125                 try {
126                     UnitTestCaseChoice target = (UnitTestCaseChoice) object;
127                     target.setSchema( (java.lang.String) value);
128                 } catch (java.lang.Exception ex) {
129                     throw new IllegalStateException(ex.toString());
130                 }
131             }
132             public java.lang.Object newInstance(java.lang.Object parent) {
133                 return null;
134             }
135         };
136         desc.setSchemaType("string");
137         desc.setHandler(handler);
138         desc.setNameSpaceURI("http://castor.exolab.org/Test");
139         desc.setMultivalued(false);
140         addFieldDescriptor(desc);
141         addSequenceElement(desc);
142 
143         //-- validation code for: _schema
144         fieldValidator = new org.exolab.castor.xml.FieldValidator();
145         { //-- local scope
146             org.exolab.castor.xml.validators.StringValidator typeValidator;
147             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
148             fieldValidator.setValidator(typeValidator);
149             typeValidator.setWhiteSpace("preserve");
150         }
151         desc.setValidator(fieldValidator);
152     }
153 
154 
155       //-----------/
156      //- Methods -/
157     //-----------/
158 
159     /**
160      * Method getAccessMode.
161      * 
162      * @return the access mode specified for this class.
163      */
164     public org.exolab.castor.mapping.AccessMode getAccessMode(
165     ) {
166         return null;
167     }
168 
169     /**
170      * Method getIdentity.
171      * 
172      * @return the identity field, null if this class has no
173      * identity.
174      */
175     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
176     ) {
177         return _identity;
178     }
179 
180     /**
181      * Method getJavaClass.
182      * 
183      * @return the Java class represented by this descriptor.
184      */
185     public java.lang.Class getJavaClass(
186     ) {
187         return org.exolab.castor.tests.framework.testDescriptor.UnitTestCaseChoice.class;
188     }
189 
190     /**
191      * Method getNameSpacePrefix.
192      * 
193      * @return the namespace prefix to use when marshaling as XML.
194      */
195     public java.lang.String getNameSpacePrefix(
196     ) {
197         return _nsPrefix;
198     }
199 
200     /**
201      * Method getNameSpaceURI.
202      * 
203      * @return the namespace URI used when marshaling and
204      * unmarshaling as XML.
205      */
206     public java.lang.String getNameSpaceURI(
207     ) {
208         return _nsURI;
209     }
210 
211     /**
212      * Method getValidator.
213      * 
214      * @return a specific validator for the class described by this
215      * ClassDescriptor.
216      */
217     public org.exolab.castor.xml.TypeValidator getValidator(
218     ) {
219         return this;
220     }
221 
222     /**
223      * Method getXMLName.
224      * 
225      * @return the XML Name for the Class being described.
226      */
227     public java.lang.String getXMLName(
228     ) {
229         return _xmlName;
230     }
231 
232     /**
233      * Method isElementDefinition.
234      * 
235      * @return true if XML schema definition of this Class is that
236      * of a global
237      * element or element with anonymous type definition.
238      */
239     public boolean isElementDefinition(
240     ) {
241         return _elementDefinition;
242     }
243 
244 }