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