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: ScriptDescriptor.java,v 1.8 2007/01/04 16:26:34 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 ScriptDescriptor.
21   * 
22   * @version $Revision: 1.8 $ $Date: 2007/01/04 16:26:34 $
23   */
24  public class ScriptDescriptor 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 ScriptDescriptor() {
57          super();
58          nsURI = "http://www.astrogrid.org/schema/CommonExecutionArchitectureBase/v1";
59          xmlName = "script";
60          
61          //-- set grouping compositor
62          setCompositorAsSequence();
63          org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
64          org.exolab.castor.xml.XMLFieldHandler              handler        = null;
65          org.exolab.castor.xml.FieldValidator               fieldValidator = null;
66          //-- initialize attribute descriptors
67          
68          //-- initialize element descriptors
69          
70          //-- _lang
71          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.astrogrid.applications.beans.v1.types.ScriptingLanguage.class, "_lang", "lang", org.exolab.castor.xml.NodeType.Element);
72          handler = (new org.exolab.castor.xml.XMLFieldHandler() {
73              public java.lang.Object getValue( java.lang.Object object ) 
74                  throws IllegalStateException
75              {
76                  Script target = (Script) object;
77                  return target.getLang();
78              }
79              public void setValue( java.lang.Object object, java.lang.Object value) 
80                  throws IllegalStateException, IllegalArgumentException
81              {
82                  try {
83                      Script target = (Script) object;
84                      target.setLang( (org.astrogrid.applications.beans.v1.types.ScriptingLanguage) value);
85                  }
86                  catch (java.lang.Exception ex) {
87                      throw new IllegalStateException(ex.toString());
88                  }
89              }
90              public java.lang.Object newInstance( java.lang.Object parent ) {
91                  return null;
92              }
93          } );
94          desc.setHandler( new org.exolab.castor.xml.handlers.EnumFieldHandler(org.astrogrid.applications.beans.v1.types.ScriptingLanguage.class, handler));
95          desc.setImmutable(true);
96          desc.setNameSpaceURI("http://www.astrogrid.org/schema/CommonExecutionArchitectureBase/v1");
97          desc.setRequired(true);
98          desc.setMultivalued(false);
99          addFieldDescriptor(desc);
100         
101         //-- validation code for: _lang
102         fieldValidator = new org.exolab.castor.xml.FieldValidator();
103         fieldValidator.setMinOccurs(1);
104         { //-- local scope
105         }
106         desc.setValidator(fieldValidator);
107         //-- _code
108         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_code", "code", org.exolab.castor.xml.NodeType.Element);
109         desc.setImmutable(true);
110         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
111             public java.lang.Object getValue( java.lang.Object object ) 
112                 throws IllegalStateException
113             {
114                 Script target = (Script) object;
115                 return target.getCode();
116             }
117             public void setValue( java.lang.Object object, java.lang.Object value) 
118                 throws IllegalStateException, IllegalArgumentException
119             {
120                 try {
121                     Script target = (Script) object;
122                     target.setCode( (java.lang.String) value);
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         desc.setNameSpaceURI("http://www.astrogrid.org/schema/CommonExecutionArchitectureBase/v1");
134         desc.setRequired(true);
135         desc.setMultivalued(false);
136         addFieldDescriptor(desc);
137         
138         //-- validation code for: _code
139         fieldValidator = new org.exolab.castor.xml.FieldValidator();
140         fieldValidator.setMinOccurs(1);
141         { //-- local scope
142             StringValidator typeValidator = new StringValidator();
143             typeValidator.setWhiteSpace("preserve");
144             fieldValidator.setValidator(typeValidator);
145         }
146         desc.setValidator(fieldValidator);
147     } //-- org.astrogrid.applications.beans.v1.ScriptDescriptor()
148 
149 
150       //-----------/
151      //- Methods -/
152     //-----------/
153 
154     /***
155      * Method getAccessMode
156      */
157     public org.exolab.castor.mapping.AccessMode getAccessMode()
158     {
159         return null;
160     } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 
161 
162     /***
163      * Method getExtends
164      */
165     public org.exolab.castor.mapping.ClassDescriptor getExtends()
166     {
167         return null;
168     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 
169 
170     /***
171      * Method getIdentity
172      */
173     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
174     {
175         return identity;
176     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 
177 
178     /***
179      * Method getJavaClass
180      */
181     public java.lang.Class getJavaClass()
182     {
183         return org.astrogrid.applications.beans.v1.Script.class;
184     } //-- java.lang.Class getJavaClass() 
185 
186     /***
187      * Method getNameSpacePrefix
188      */
189     public java.lang.String getNameSpacePrefix()
190     {
191         return nsPrefix;
192     } //-- java.lang.String getNameSpacePrefix() 
193 
194     /***
195      * Method getNameSpaceURI
196      */
197     public java.lang.String getNameSpaceURI()
198     {
199         return nsURI;
200     } //-- java.lang.String getNameSpaceURI() 
201 
202     /***
203      * Method getValidator
204      */
205     public org.exolab.castor.xml.TypeValidator getValidator()
206     {
207         return this;
208     } //-- org.exolab.castor.xml.TypeValidator getValidator() 
209 
210     /***
211      * Method getXMLName
212      */
213     public java.lang.String getXMLName()
214     {
215         return xmlName;
216     } //-- java.lang.String getXMLName() 
217 
218 }