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: FormatDescriptor.java,v 1.2 2007/01/04 16:26:25 clq2 Exp $
6    */
7   
8   package org.astrogrid.registry.beans.v10.resource.dataservice;
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 FormatDescriptor.
21   * 
22   * @version $Revision: 1.2 $ $Date: 2007/01/04 16:26:25 $
23   */
24  public class FormatDescriptor 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 FormatDescriptor() {
57          super();
58          nsURI = "http://www.ivoa.net/xml/VODataService/v0.5";
59          xmlName = "Format";
60          org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
61          org.exolab.castor.xml.XMLFieldHandler              handler        = null;
62          org.exolab.castor.xml.FieldValidator               fieldValidator = null;
63          //-- _content
64          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
65          desc.setImmutable(true);
66          handler = (new org.exolab.castor.xml.XMLFieldHandler() {
67              public java.lang.Object getValue( java.lang.Object object ) 
68                  throws IllegalStateException
69              {
70                  Format target = (Format) object;
71                  return target.getContent();
72              }
73              public void setValue( java.lang.Object object, java.lang.Object value) 
74                  throws IllegalStateException, IllegalArgumentException
75              {
76                  try {
77                      Format target = (Format) object;
78                      target.setContent( (java.lang.String) value);
79                  }
80                  catch (java.lang.Exception ex) {
81                      throw new IllegalStateException(ex.toString());
82                  }
83              }
84              public java.lang.Object newInstance( java.lang.Object parent ) {
85                  return null;
86              }
87          } );
88          desc.setHandler(handler);
89          addFieldDescriptor(desc);
90          
91          //-- validation code for: _content
92          fieldValidator = new org.exolab.castor.xml.FieldValidator();
93          { //-- local scope
94              StringValidator typeValidator = new StringValidator();
95              typeValidator.setWhiteSpace("preserve");
96              fieldValidator.setValidator(typeValidator);
97          }
98          desc.setValidator(fieldValidator);
99          //-- initialize attribute descriptors
100         
101         //-- _isMIMEType
102         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_isMIMEType", "isMIMEType", org.exolab.castor.xml.NodeType.Attribute);
103         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
104             public java.lang.Object getValue( java.lang.Object object ) 
105                 throws IllegalStateException
106             {
107                 Format target = (Format) object;
108                 if(!target.hasIsMIMEType())
109                     return null;
110                 return new Boolean(target.getIsMIMEType());
111             }
112             public void setValue( java.lang.Object object, java.lang.Object value) 
113                 throws IllegalStateException, IllegalArgumentException
114             {
115                 try {
116                     Format target = (Format) object;
117                     // if null, use delete method for optional primitives 
118                     if (value == null) {
119                         target.deleteIsMIMEType();
120                         return;
121                     }
122                     target.setIsMIMEType( ((Boolean)value).booleanValue());
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         addFieldDescriptor(desc);
134         
135         //-- validation code for: _isMIMEType
136         fieldValidator = new org.exolab.castor.xml.FieldValidator();
137         { //-- local scope
138             BooleanValidator typeValidator = new BooleanValidator();
139             fieldValidator.setValidator(typeValidator);
140         }
141         desc.setValidator(fieldValidator);
142         //-- initialize element descriptors
143         
144     } //-- org.astrogrid.registry.beans.v10.resource.dataservice.FormatDescriptor()
145 
146 
147       //-----------/
148      //- Methods -/
149     //-----------/
150 
151     /***
152      * Method getAccessMode
153      */
154     public org.exolab.castor.mapping.AccessMode getAccessMode()
155     {
156         return null;
157     } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 
158 
159     /***
160      * Method getExtends
161      */
162     public org.exolab.castor.mapping.ClassDescriptor getExtends()
163     {
164         return null;
165     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 
166 
167     /***
168      * Method getIdentity
169      */
170     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
171     {
172         return identity;
173     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 
174 
175     /***
176      * Method getJavaClass
177      */
178     public java.lang.Class getJavaClass()
179     {
180         return org.astrogrid.registry.beans.v10.resource.dataservice.Format.class;
181     } //-- java.lang.Class getJavaClass() 
182 
183     /***
184      * Method getNameSpacePrefix
185      */
186     public java.lang.String getNameSpacePrefix()
187     {
188         return nsPrefix;
189     } //-- java.lang.String getNameSpacePrefix() 
190 
191     /***
192      * Method getNameSpaceURI
193      */
194     public java.lang.String getNameSpaceURI()
195     {
196         return nsURI;
197     } //-- java.lang.String getNameSpaceURI() 
198 
199     /***
200      * Method getValidator
201      */
202     public org.exolab.castor.xml.TypeValidator getValidator()
203     {
204         return this;
205     } //-- org.exolab.castor.xml.TypeValidator getValidator() 
206 
207     /***
208      * Method getXMLName
209      */
210     public java.lang.String getXMLName()
211     {
212         return xmlName;
213     } //-- java.lang.String getXMLName() 
214 
215 }