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: ResourceReferenceTypeDescriptor.java,v 1.14 2007/01/04 16:26:23 clq2 Exp $
6    */
7   
8   package org.astrogrid.registry.beans.resource;
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 ResourceReferenceTypeDescriptor.
21   * 
22   * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:23 $
23   */
24  public class ResourceReferenceTypeDescriptor 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 ResourceReferenceTypeDescriptor() {
57          super();
58          nsURI = "http://www.ivoa.net/xml/VOResource/v0.9";
59          xmlName = "ResourceReferenceType";
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          //-- _identifier
71          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.astrogrid.registry.beans.resource.IdentifierType.class, "_identifier", "Identifier", 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                  ResourceReferenceType target = (ResourceReferenceType) object;
77                  return target.getIdentifier();
78              }
79              public void setValue( java.lang.Object object, java.lang.Object value) 
80                  throws IllegalStateException, IllegalArgumentException
81              {
82                  try {
83                      ResourceReferenceType target = (ResourceReferenceType) object;
84                      target.setIdentifier( (org.astrogrid.registry.beans.resource.IdentifierType) 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 new org.astrogrid.registry.beans.resource.IdentifierType();
92              }
93          } );
94          desc.setHandler(handler);
95          desc.setNameSpaceURI("http://www.ivoa.net/xml/VOResource/v0.9");
96          desc.setMultivalued(false);
97          addFieldDescriptor(desc);
98          
99          //-- validation code for: _identifier
100         fieldValidator = new org.exolab.castor.xml.FieldValidator();
101         { //-- local scope
102         }
103         desc.setValidator(fieldValidator);
104         //-- _title
105         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "Title", org.exolab.castor.xml.NodeType.Element);
106         desc.setImmutable(true);
107         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
108             public java.lang.Object getValue( java.lang.Object object ) 
109                 throws IllegalStateException
110             {
111                 ResourceReferenceType target = (ResourceReferenceType) object;
112                 return target.getTitle();
113             }
114             public void setValue( java.lang.Object object, java.lang.Object value) 
115                 throws IllegalStateException, IllegalArgumentException
116             {
117                 try {
118                     ResourceReferenceType target = (ResourceReferenceType) object;
119                     target.setTitle( (java.lang.String) value);
120                 }
121                 catch (java.lang.Exception ex) {
122                     throw new IllegalStateException(ex.toString());
123                 }
124             }
125             public java.lang.Object newInstance( java.lang.Object parent ) {
126                 return null;
127             }
128         } );
129         desc.setHandler(handler);
130         desc.setNameSpaceURI("http://www.ivoa.net/xml/VOResource/v0.9");
131         desc.setRequired(true);
132         desc.setMultivalued(false);
133         addFieldDescriptor(desc);
134         
135         //-- validation code for: _title
136         fieldValidator = new org.exolab.castor.xml.FieldValidator();
137         fieldValidator.setMinOccurs(1);
138         { //-- local scope
139             StringValidator typeValidator = new StringValidator();
140             typeValidator.setWhiteSpace("preserve");
141             fieldValidator.setValidator(typeValidator);
142         }
143         desc.setValidator(fieldValidator);
144         //-- _description
145         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "Description", org.exolab.castor.xml.NodeType.Element);
146         desc.setImmutable(true);
147         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
148             public java.lang.Object getValue( java.lang.Object object ) 
149                 throws IllegalStateException
150             {
151                 ResourceReferenceType target = (ResourceReferenceType) object;
152                 return target.getDescription();
153             }
154             public void setValue( java.lang.Object object, java.lang.Object value) 
155                 throws IllegalStateException, IllegalArgumentException
156             {
157                 try {
158                     ResourceReferenceType target = (ResourceReferenceType) object;
159                     target.setDescription( (java.lang.String) value);
160                 }
161                 catch (java.lang.Exception ex) {
162                     throw new IllegalStateException(ex.toString());
163                 }
164             }
165             public java.lang.Object newInstance( java.lang.Object parent ) {
166                 return null;
167             }
168         } );
169         desc.setHandler(handler);
170         desc.setNameSpaceURI("http://www.ivoa.net/xml/VOResource/v0.9");
171         desc.setMultivalued(false);
172         addFieldDescriptor(desc);
173         
174         //-- validation code for: _description
175         fieldValidator = new org.exolab.castor.xml.FieldValidator();
176         { //-- local scope
177             StringValidator typeValidator = new StringValidator();
178             typeValidator.setWhiteSpace("preserve");
179             fieldValidator.setValidator(typeValidator);
180         }
181         desc.setValidator(fieldValidator);
182         //-- _referenceURL
183         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_referenceURL", "ReferenceURL", org.exolab.castor.xml.NodeType.Element);
184         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
185             public java.lang.Object getValue( java.lang.Object object ) 
186                 throws IllegalStateException
187             {
188                 ResourceReferenceType target = (ResourceReferenceType) object;
189                 return target.getReferenceURL();
190             }
191             public void setValue( java.lang.Object object, java.lang.Object value) 
192                 throws IllegalStateException, IllegalArgumentException
193             {
194                 try {
195                     ResourceReferenceType target = (ResourceReferenceType) object;
196                     target.setReferenceURL( (java.lang.String) value);
197                 }
198                 catch (java.lang.Exception ex) {
199                     throw new IllegalStateException(ex.toString());
200                 }
201             }
202             public java.lang.Object newInstance( java.lang.Object parent ) {
203                 return new java.lang.String();
204             }
205         } );
206         desc.setHandler(handler);
207         desc.setNameSpaceURI("http://www.ivoa.net/xml/VOResource/v0.9");
208         desc.setMultivalued(false);
209         addFieldDescriptor(desc);
210         
211         //-- validation code for: _referenceURL
212         fieldValidator = new org.exolab.castor.xml.FieldValidator();
213         { //-- local scope
214         }
215         desc.setValidator(fieldValidator);
216     } //-- org.astrogrid.registry.beans.resource.ResourceReferenceTypeDescriptor()
217 
218 
219       //-----------/
220      //- Methods -/
221     //-----------/
222 
223     /***
224      * Method getAccessMode
225      */
226     public org.exolab.castor.mapping.AccessMode getAccessMode()
227     {
228         return null;
229     } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 
230 
231     /***
232      * Method getExtends
233      */
234     public org.exolab.castor.mapping.ClassDescriptor getExtends()
235     {
236         return null;
237     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 
238 
239     /***
240      * Method getIdentity
241      */
242     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
243     {
244         return identity;
245     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 
246 
247     /***
248      * Method getJavaClass
249      */
250     public java.lang.Class getJavaClass()
251     {
252         return org.astrogrid.registry.beans.resource.ResourceReferenceType.class;
253     } //-- java.lang.Class getJavaClass() 
254 
255     /***
256      * Method getNameSpacePrefix
257      */
258     public java.lang.String getNameSpacePrefix()
259     {
260         return nsPrefix;
261     } //-- java.lang.String getNameSpacePrefix() 
262 
263     /***
264      * Method getNameSpaceURI
265      */
266     public java.lang.String getNameSpaceURI()
267     {
268         return nsURI;
269     } //-- java.lang.String getNameSpaceURI() 
270 
271     /***
272      * Method getValidator
273      */
274     public org.exolab.castor.xml.TypeValidator getValidator()
275     {
276         return this;
277     } //-- org.exolab.castor.xml.TypeValidator getValidator() 
278 
279     /***
280      * Method getXMLName
281      */
282     public java.lang.String getXMLName()
283     {
284         return xmlName;
285     } //-- java.lang.String getXMLName() 
286 
287 }