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