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.SchemaDifferencesType;
15  
16  /**
17   * Class SchemaDifferencesTypeDescriptor.
18   * 
19   * @version $Revision$ $Date$
20   */
21  public class SchemaDifferencesTypeDescriptor 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 SchemaDifferencesTypeDescriptor() {
59          super();
60          _nsURI = "http://castor.exolab.org/Test";
61          _xmlName = "SchemaDifferencesType";
62          _elementDefinition = false;
63          org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
64          org.exolab.castor.mapping.FieldHandler             handler        = null;
65          org.exolab.castor.xml.FieldValidator               fieldValidator = null;
66          //-- _content
67          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
68          handler = new org.exolab.castor.xml.XMLFieldHandler() {
69              public java.lang.Object getValue( java.lang.Object object ) 
70                  throws IllegalStateException
71              {
72                  SchemaDifferencesType target = (SchemaDifferencesType) object;
73                  if (!target.hasContent()) { return null; }
74                  return new java.lang.Integer(target.getContent());
75              }
76              public void setValue( java.lang.Object object, java.lang.Object value) 
77                  throws IllegalStateException, IllegalArgumentException
78              {
79                  try {
80                      SchemaDifferencesType target = (SchemaDifferencesType) object;
81                      // if null, use delete method for optional primitives 
82                      if (value == null) {
83                          target.deleteContent();
84                          return;
85                      }
86                      target.setContent( ((java.lang.Integer) value).intValue());
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 null;
93              }
94          };
95          desc.setSchemaType("int");
96          desc.setHandler(handler);
97          addFieldDescriptor(desc);
98  
99          //-- validation code for: _content
100         fieldValidator = new org.exolab.castor.xml.FieldValidator();
101         { //-- local scope
102             org.exolab.castor.xml.validators.IntValidator typeValidator;
103             typeValidator = new org.exolab.castor.xml.validators.IntValidator();
104             fieldValidator.setValidator(typeValidator);
105             typeValidator.setMinInclusive(-2147483648);
106             typeValidator.setMaxInclusive(2147483647);
107         }
108         desc.setValidator(fieldValidator);
109         //-- initialize attribute descriptors
110 
111         //-- _failureStep
112         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType.class, "_failureStep", "FailureStep", org.exolab.castor.xml.NodeType.Attribute);
113         handler = new org.exolab.castor.xml.XMLFieldHandler() {
114             public java.lang.Object getValue( java.lang.Object object ) 
115                 throws IllegalStateException
116             {
117                 SchemaDifferencesType target = (SchemaDifferencesType) object;
118                 return target.getFailureStep();
119             }
120             public void setValue( java.lang.Object object, java.lang.Object value) 
121                 throws IllegalStateException, IllegalArgumentException
122             {
123                 try {
124                     SchemaDifferencesType target = (SchemaDifferencesType) object;
125                     target.setFailureStep( (org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType) value);
126                 } catch (java.lang.Exception ex) {
127                     throw new IllegalStateException(ex.toString());
128                 }
129             }
130             public java.lang.Object newInstance(java.lang.Object parent) {
131                 return null;
132             }
133         };
134         handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType.class, handler);
135         desc.setImmutable(true);
136         desc.setSchemaType("FailureStepType");
137         desc.setHandler(handler);
138         desc.setRequired(true);
139         desc.setMultivalued(false);
140         addFieldDescriptor(desc);
141 
142         //-- validation code for: _failureStep
143         fieldValidator = new org.exolab.castor.xml.FieldValidator();
144         fieldValidator.setMinOccurs(1);
145         { //-- local scope
146         }
147         desc.setValidator(fieldValidator);
148         //-- initialize element descriptors
149 
150     }
151 
152 
153       //-----------/
154      //- Methods -/
155     //-----------/
156 
157     /**
158      * Method getAccessMode.
159      * 
160      * @return the access mode specified for this class.
161      */
162     public org.exolab.castor.mapping.AccessMode getAccessMode(
163     ) {
164         return null;
165     }
166 
167     /**
168      * Method getIdentity.
169      * 
170      * @return the identity field, null if this class has no
171      * identity.
172      */
173     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
174     ) {
175         return _identity;
176     }
177 
178     /**
179      * Method getJavaClass.
180      * 
181      * @return the Java class represented by this descriptor.
182      */
183     public java.lang.Class getJavaClass(
184     ) {
185         return org.exolab.castor.tests.framework.testDescriptor.SchemaDifferencesType.class;
186     }
187 
188     /**
189      * Method getNameSpacePrefix.
190      * 
191      * @return the namespace prefix to use when marshaling as XML.
192      */
193     public java.lang.String getNameSpacePrefix(
194     ) {
195         return _nsPrefix;
196     }
197 
198     /**
199      * Method getNameSpaceURI.
200      * 
201      * @return the namespace URI used when marshaling and
202      * unmarshaling as XML.
203      */
204     public java.lang.String getNameSpaceURI(
205     ) {
206         return _nsURI;
207     }
208 
209     /**
210      * Method getValidator.
211      * 
212      * @return a specific validator for the class described by this
213      * ClassDescriptor.
214      */
215     public org.exolab.castor.xml.TypeValidator getValidator(
216     ) {
217         return this;
218     }
219 
220     /**
221      * Method getXMLName.
222      * 
223      * @return the XML Name for the Class being described.
224      */
225     public java.lang.String getXMLName(
226     ) {
227         return _xmlName;
228     }
229 
230     /**
231      * Method isElementDefinition.
232      * 
233      * @return true if XML schema definition of this Class is that
234      * of a global
235      * element or element with anonymous type definition.
236      */
237     public boolean isElementDefinition(
238     ) {
239         return _elementDefinition;
240     }
241 
242 }