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: SetDescriptor.java,v 1.10 2007/01/04 16:26:27 clq2 Exp $
6    */
7   
8   package org.astrogrid.workflow.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 SetDescriptor.
21   * 
22   * @version $Revision: 1.10 $ $Date: 2007/01/04 16:26:27 $
23   */
24  public class SetDescriptor extends org.astrogrid.workflow.beans.v1.AbstractActivityDescriptor {
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 SetDescriptor() {
57          super();
58          setExtendsWithoutFlatten(new org.astrogrid.workflow.beans.v1.AbstractActivityDescriptor());
59          nsURI = "http://www.astrogrid.org/schema/AGWorkflow/v1";
60          xmlName = "set";
61          org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
62          org.exolab.castor.xml.XMLFieldHandler              handler        = null;
63          org.exolab.castor.xml.FieldValidator               fieldValidator = null;
64          //-- initialize attribute descriptors
65          
66          //-- _var
67          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_var", "var", org.exolab.castor.xml.NodeType.Attribute);
68          handler = (new org.exolab.castor.xml.XMLFieldHandler() {
69              public java.lang.Object getValue( java.lang.Object object ) 
70                  throws IllegalStateException
71              {
72                  Set target = (Set) object;
73                  return target.getVar();
74              }
75              public void setValue( java.lang.Object object, java.lang.Object value) 
76                  throws IllegalStateException, IllegalArgumentException
77              {
78                  try {
79                      Set target = (Set) object;
80                      target.setVar( (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 new java.lang.String();
88              }
89          } );
90          desc.setHandler(handler);
91          desc.setRequired(true);
92          addFieldDescriptor(desc);
93          
94          //-- validation code for: _var
95          fieldValidator = new org.exolab.castor.xml.FieldValidator();
96          fieldValidator.setMinOccurs(1);
97          { //-- local scope
98              NameValidator typeValidator = new NameValidator(NameValidator.NCNAME);
99              fieldValidator.setValidator(typeValidator);
100         }
101         desc.setValidator(fieldValidator);
102         //-- _value
103         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_value", "value", org.exolab.castor.xml.NodeType.Attribute);
104         desc.setImmutable(true);
105         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
106             public java.lang.Object getValue( java.lang.Object object ) 
107                 throws IllegalStateException
108             {
109                 Set target = (Set) object;
110                 return target.getValue();
111             }
112             public void setValue( java.lang.Object object, java.lang.Object value) 
113                 throws IllegalStateException, IllegalArgumentException
114             {
115                 try {
116                     Set target = (Set) object;
117                     target.setValue( (java.lang.String) value);
118                 }
119                 catch (java.lang.Exception ex) {
120                     throw new IllegalStateException(ex.toString());
121                 }
122             }
123             public java.lang.Object newInstance( java.lang.Object parent ) {
124                 return null;
125             }
126         } );
127         desc.setHandler(handler);
128         addFieldDescriptor(desc);
129         
130         //-- validation code for: _value
131         fieldValidator = new org.exolab.castor.xml.FieldValidator();
132         { //-- local scope
133             StringValidator typeValidator = new StringValidator();
134             typeValidator.setWhiteSpace("preserve");
135             fieldValidator.setValidator(typeValidator);
136         }
137         desc.setValidator(fieldValidator);
138         //-- initialize element descriptors
139         
140     } //-- org.astrogrid.workflow.beans.v1.SetDescriptor()
141 
142 
143       //-----------/
144      //- Methods -/
145     //-----------/
146 
147     /***
148      * Method getAccessMode
149      */
150     public org.exolab.castor.mapping.AccessMode getAccessMode()
151     {
152         return null;
153     } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 
154 
155     /***
156      * Method getExtends
157      */
158     public org.exolab.castor.mapping.ClassDescriptor getExtends()
159     {
160         return super.getExtends();
161     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 
162 
163     /***
164      * Method getIdentity
165      */
166     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
167     {
168         if (identity == null)
169             return super.getIdentity();
170         return identity;
171     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 
172 
173     /***
174      * Method getJavaClass
175      */
176     public java.lang.Class getJavaClass()
177     {
178         return org.astrogrid.workflow.beans.v1.Set.class;
179     } //-- java.lang.Class getJavaClass() 
180 
181     /***
182      * Method getNameSpacePrefix
183      */
184     public java.lang.String getNameSpacePrefix()
185     {
186         return nsPrefix;
187     } //-- java.lang.String getNameSpacePrefix() 
188 
189     /***
190      * Method getNameSpaceURI
191      */
192     public java.lang.String getNameSpaceURI()
193     {
194         return nsURI;
195     } //-- java.lang.String getNameSpaceURI() 
196 
197     /***
198      * Method getValidator
199      */
200     public org.exolab.castor.xml.TypeValidator getValidator()
201     {
202         return this;
203     } //-- org.exolab.castor.xml.TypeValidator getValidator() 
204 
205     /***
206      * Method getXMLName
207      */
208     public java.lang.String getXMLName()
209     {
210         return xmlName;
211     } //-- java.lang.String getXMLName() 
212 
213 }