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: FITSDescriptor.java,v 1.14 2007/01/04 16:26:13 clq2 Exp $
6    */
7   
8   package org.astrogrid.registry.beans.resource.votable;
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 FITSDescriptor.
21   * 
22   * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:13 $
23   */
24  public class FITSDescriptor extends org.astrogrid.registry.beans.resource.votable.StreamTABLEFORMATTypeDescriptor {
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 FITSDescriptor() {
57          super();
58          setExtendsWithoutFlatten(new org.astrogrid.registry.beans.resource.votable.StreamTABLEFORMATTypeDescriptor());
59          nsURI = "http://www.ivoa.net/xml/VOTable/v1.0";
60          xmlName = "FITS";
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          //-- _extnum
67          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_extnum", "extnum", 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                  FITS target = (FITS) object;
73                  if(!target.hasExtnum())
74                      return null;
75                  return new Integer(target.getExtnum());
76              }
77              public void setValue( java.lang.Object object, java.lang.Object value) 
78                  throws IllegalStateException, IllegalArgumentException
79              {
80                  try {
81                      FITS target = (FITS) object;
82                      // if null, use delete method for optional primitives 
83                      if (value == null) {
84                          target.deleteExtnum();
85                          return;
86                      }
87                      target.setExtnum( ((Integer)value).intValue());
88                  }
89                  catch (java.lang.Exception ex) {
90                      throw new IllegalStateException(ex.toString());
91                  }
92              }
93              public java.lang.Object newInstance( java.lang.Object parent ) {
94                  return null;
95              }
96          } );
97          desc.setHandler(handler);
98          addFieldDescriptor(desc);
99          
100         //-- validation code for: _extnum
101         fieldValidator = new org.exolab.castor.xml.FieldValidator();
102         { //-- local scope
103             IntegerValidator typeValidator = new IntegerValidator();
104             typeValidator.setMinInclusive(1);
105             fieldValidator.setValidator(typeValidator);
106         }
107         desc.setValidator(fieldValidator);
108         //-- initialize element descriptors
109         
110     } //-- org.astrogrid.registry.beans.resource.votable.FITSDescriptor()
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 super.getExtends();
131     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 
132 
133     /***
134      * Method getIdentity
135      */
136     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
137     {
138         if (identity == null)
139             return super.getIdentity();
140         return identity;
141     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 
142 
143     /***
144      * Method getJavaClass
145      */
146     public java.lang.Class getJavaClass()
147     {
148         return org.astrogrid.registry.beans.resource.votable.FITS.class;
149     } //-- java.lang.Class getJavaClass() 
150 
151     /***
152      * Method getNameSpacePrefix
153      */
154     public java.lang.String getNameSpacePrefix()
155     {
156         return nsPrefix;
157     } //-- java.lang.String getNameSpacePrefix() 
158 
159     /***
160      * Method getNameSpaceURI
161      */
162     public java.lang.String getNameSpaceURI()
163     {
164         return nsURI;
165     } //-- java.lang.String getNameSpaceURI() 
166 
167     /***
168      * Method getValidator
169      */
170     public org.exolab.castor.xml.TypeValidator getValidator()
171     {
172         return this;
173     } //-- org.exolab.castor.xml.TypeValidator getValidator() 
174 
175     /***
176      * Method getXMLName
177      */
178     public java.lang.String getXMLName()
179     {
180         return xmlName;
181     } //-- java.lang.String getXMLName() 
182 
183 }