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: OptionListDescriptor.java,v 1.8 2007/01/04 16:26:33 clq2 Exp $
6    */
7   
8   package org.astrogrid.applications.beans.v1.parameters;
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 OptionListDescriptor.
21   * 
22   * @version $Revision: 1.8 $ $Date: 2007/01/04 16:26:33 $
23   */
24  public class OptionListDescriptor 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 OptionListDescriptor() {
57          super();
58          nsURI = "http://www.astrogrid.org/schema/AGParameterDefinition/v1";
59          xmlName = "OptionList";
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          //-- _optionValList
71          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_optionValList", "OptionVal", org.exolab.castor.xml.NodeType.Element);
72          desc.setImmutable(true);
73          handler = (new org.exolab.castor.xml.XMLFieldHandler() {
74              public java.lang.Object getValue( java.lang.Object object ) 
75                  throws IllegalStateException
76              {
77                  OptionList target = (OptionList) object;
78                  return target.getOptionVal();
79              }
80              public void setValue( java.lang.Object object, java.lang.Object value) 
81                  throws IllegalStateException, IllegalArgumentException
82              {
83                  try {
84                      OptionList target = (OptionList) object;
85                      target.addOptionVal( (java.lang.String) value);
86                  }
87                  catch (java.lang.Exception ex) {
88                      throw new IllegalStateException(ex.toString());
89                  }
90              }
91              public java.lang.Object newInstance( java.lang.Object parent ) {
92                  return null;
93              }
94          } );
95          desc.setHandler(handler);
96          desc.setNameSpaceURI("http://www.astrogrid.org/schema/AGParameterDefinition/v1");
97          desc.setRequired(true);
98          desc.setMultivalued(true);
99          addFieldDescriptor(desc);
100         
101         //-- validation code for: _optionValList
102         fieldValidator = new org.exolab.castor.xml.FieldValidator();
103         fieldValidator.setMinOccurs(1);
104         { //-- local scope
105             StringValidator typeValidator = new StringValidator();
106             typeValidator.setWhiteSpace("preserve");
107             fieldValidator.setValidator(typeValidator);
108         }
109         desc.setValidator(fieldValidator);
110     } //-- org.astrogrid.applications.beans.v1.parameters.OptionListDescriptor()
111 
112 
113       //-----------/
114      //- Methods -/
115     //-----------/
116 
117     /***
118      * Method getAccessMode
119      */
120     public org.exolab.castor.mapping.AccessMode getAccessMode()
121     {
122         return null;
123     } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 
124 
125     /***
126      * Method getExtends
127      */
128     public org.exolab.castor.mapping.ClassDescriptor getExtends()
129     {
130         return null;
131     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 
132 
133     /***
134      * Method getIdentity
135      */
136     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
137     {
138         return identity;
139     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 
140 
141     /***
142      * Method getJavaClass
143      */
144     public java.lang.Class getJavaClass()
145     {
146         return org.astrogrid.applications.beans.v1.parameters.OptionList.class;
147     } //-- java.lang.Class getJavaClass() 
148 
149     /***
150      * Method getNameSpacePrefix
151      */
152     public java.lang.String getNameSpacePrefix()
153     {
154         return nsPrefix;
155     } //-- java.lang.String getNameSpacePrefix() 
156 
157     /***
158      * Method getNameSpaceURI
159      */
160     public java.lang.String getNameSpaceURI()
161     {
162         return nsURI;
163     } //-- java.lang.String getNameSpaceURI() 
164 
165     /***
166      * Method getValidator
167      */
168     public org.exolab.castor.xml.TypeValidator getValidator()
169     {
170         return this;
171     } //-- org.exolab.castor.xml.TypeValidator getValidator() 
172 
173     /***
174      * Method getXMLName
175      */
176     public java.lang.String getXMLName()
177     {
178         return xmlName;
179     } //-- java.lang.String getXMLName() 
180 
181 }