View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
4    * Schema.
5    * $Id: ParameterRefDescriptor.java,v 1.36 2007/01/04 16:26:35 clq2 Exp $
6    */
7   
8   package org.astrogrid.applications.beans.v1;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import org.exolab.castor.mapping.AccessMode;
15  import org.exolab.castor.xml.TypeValidator;
16  import org.exolab.castor.xml.XMLFieldDescriptor;
17  import org.exolab.castor.xml.validators.*;
18  
19  /***
20   * Class ParameterRefDescriptor.
21   * 
22   * @version $Revision: 1.36 $ $Date: 2007/01/04 16:26:35 $
23   */
24  public class ParameterRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
25  
26  
27        //--------------------------/
28       //- Class/Member Variables -/
29      //--------------------------/
30  
31      /***
32       * Field nsPrefix
33       */
34      private java.lang.String nsPrefix;
35  
36      /***
37       * Field nsURI
38       */
39      private java.lang.String nsURI;
40  
41      /***
42       * Field xmlName
43       */
44      private java.lang.String xmlName;
45  
46      /***
47       * Field identity
48       */
49      private org.exolab.castor.xml.XMLFieldDescriptor identity;
50  
51  
52        //----------------/
53       //- Constructors -/
54      //----------------/
55  
56      public ParameterRefDescriptor() {
57          super();
58          nsURI = "http://www.astrogrid.org/schema/CommonExecutionArchitectureBase/v1";
59          xmlName = "parameterRef";
60          org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
61          org.exolab.castor.xml.XMLFieldHandler              handler        = null;
62          org.exolab.castor.xml.FieldValidator               fieldValidator = null;
63          //-- initialize attribute descriptors
64          
65          //-- _ref
66          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_ref", "ref", org.exolab.castor.xml.NodeType.Attribute);
67          desc.setImmutable(true);
68          handler = (new org.exolab.castor.xml.XMLFieldHandler() {
69              public java.lang.Object getValue( java.lang.Object object ) 
70                  throws IllegalStateException
71              {
72                  ParameterRef target = (ParameterRef) object;
73                  return target.getRef();
74              }
75              public void setValue( java.lang.Object object, java.lang.Object value) 
76                  throws IllegalStateException, IllegalArgumentException
77              {
78                  try {
79                      ParameterRef target = (ParameterRef) object;
80                      target.setRef( (java.lang.String) value);
81                  }
82                  catch (java.lang.Exception ex) {
83                      throw new IllegalStateException(ex.toString());
84                  }
85              }
86              public java.lang.Object newInstance( java.lang.Object parent ) {
87                  return null;
88              }
89          } );
90          desc.setHandler(handler);
91          addFieldDescriptor(desc);
92          
93          //-- validation code for: _ref
94          fieldValidator = new org.exolab.castor.xml.FieldValidator();
95          { //-- local scope
96              StringValidator typeValidator = new StringValidator();
97              typeValidator.setWhiteSpace("preserve");
98              fieldValidator.setValidator(typeValidator);
99          }
100         desc.setValidator(fieldValidator);
101         //-- _minoccurs
102         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_minoccurs", "minoccurs", org.exolab.castor.xml.NodeType.Attribute);
103         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
104             public java.lang.Object getValue( java.lang.Object object ) 
105                 throws IllegalStateException
106             {
107                 ParameterRef target = (ParameterRef) object;
108                 if(!target.hasMinoccurs())
109                     return null;
110                 return new Integer(target.getMinoccurs());
111             }
112             public void setValue( java.lang.Object object, java.lang.Object value) 
113                 throws IllegalStateException, IllegalArgumentException
114             {
115                 try {
116                     ParameterRef target = (ParameterRef) object;
117                     // if null, use delete method for optional primitives 
118                     if (value == null) {
119                         target.deleteMinoccurs();
120                         return;
121                     }
122                     target.setMinoccurs( ((Integer)value).intValue());
123                 }
124                 catch (java.lang.Exception ex) {
125                     throw new IllegalStateException(ex.toString());
126                 }
127             }
128             public java.lang.Object newInstance( java.lang.Object parent ) {
129                 return null;
130             }
131         } );
132         desc.setHandler(handler);
133         addFieldDescriptor(desc);
134         
135         //-- validation code for: _minoccurs
136         fieldValidator = new org.exolab.castor.xml.FieldValidator();
137         { //-- local scope
138             IntegerValidator typeValidator= new IntegerValidator();
139             fieldValidator.setValidator(typeValidator);
140         }
141         desc.setValidator(fieldValidator);
142         //-- _maxoccurs
143         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_maxoccurs", "maxoccurs", org.exolab.castor.xml.NodeType.Attribute);
144         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
145             public java.lang.Object getValue( java.lang.Object object ) 
146                 throws IllegalStateException
147             {
148                 ParameterRef target = (ParameterRef) object;
149                 if(!target.hasMaxoccurs())
150                     return null;
151                 return new Integer(target.getMaxoccurs());
152             }
153             public void setValue( java.lang.Object object, java.lang.Object value) 
154                 throws IllegalStateException, IllegalArgumentException
155             {
156                 try {
157                     ParameterRef target = (ParameterRef) object;
158                     // if null, use delete method for optional primitives 
159                     if (value == null) {
160                         target.deleteMaxoccurs();
161                         return;
162                     }
163                     target.setMaxoccurs( ((Integer)value).intValue());
164                 }
165                 catch (java.lang.Exception ex) {
166                     throw new IllegalStateException(ex.toString());
167                 }
168             }
169             public java.lang.Object newInstance( java.lang.Object parent ) {
170                 return null;
171             }
172         } );
173         desc.setHandler(handler);
174         addFieldDescriptor(desc);
175         
176         //-- validation code for: _maxoccurs
177         fieldValidator = new org.exolab.castor.xml.FieldValidator();
178         { //-- local scope
179             IntegerValidator typeValidator= new IntegerValidator();
180             fieldValidator.setValidator(typeValidator);
181         }
182         desc.setValidator(fieldValidator);
183         //-- initialize element descriptors
184         
185     } //-- org.astrogrid.applications.beans.v1.ParameterRefDescriptor()
186 
187 
188       //-----------/
189      //- Methods -/
190     //-----------/
191 
192     /***
193      * Method getAccessMode
194      */
195     public org.exolab.castor.mapping.AccessMode getAccessMode()
196     {
197         return null;
198     } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 
199 
200     /***
201      * Method getExtends
202      */
203     public org.exolab.castor.mapping.ClassDescriptor getExtends()
204     {
205         return null;
206     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 
207 
208     /***
209      * Method getIdentity
210      */
211     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
212     {
213         return identity;
214     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 
215 
216     /***
217      * Method getJavaClass
218      */
219     public java.lang.Class getJavaClass()
220     {
221         return org.astrogrid.applications.beans.v1.ParameterRef.class;
222     } //-- java.lang.Class getJavaClass() 
223 
224     /***
225      * Method getNameSpacePrefix
226      */
227     public java.lang.String getNameSpacePrefix()
228     {
229         return nsPrefix;
230     } //-- java.lang.String getNameSpacePrefix() 
231 
232     /***
233      * Method getNameSpaceURI
234      */
235     public java.lang.String getNameSpaceURI()
236     {
237         return nsURI;
238     } //-- java.lang.String getNameSpaceURI() 
239 
240     /***
241      * Method getValidator
242      */
243     public org.exolab.castor.xml.TypeValidator getValidator()
244     {
245         return this;
246     } //-- org.exolab.castor.xml.TypeValidator getValidator() 
247 
248     /***
249      * Method getXMLName
250      */
251     public java.lang.String getXMLName()
252     {
253         return xmlName;
254     } //-- java.lang.String getXMLName() 
255 
256 }