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: SourceDescriptor.java,v 1.2 2007/01/04 16:26:24 clq2 Exp $
6    */
7   
8   package org.astrogrid.registry.beans.v10.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 SourceDescriptor.
21   * 
22   * @version $Revision: 1.2 $ $Date: 2007/01/04 16:26:24 $
23   */
24  public class SourceDescriptor 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 SourceDescriptor() {
57          super();
58          nsURI = "http://www.ivoa.net/xml/VOResource/v0.10";
59          xmlName = "Source";
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                  Source target = (Source) 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                      Source target = (Source) 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         //-- _format
102         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_format", "format", org.exolab.castor.xml.NodeType.Attribute);
103         desc.setImmutable(true);
104         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
105             public java.lang.Object getValue( java.lang.Object object ) 
106                 throws IllegalStateException
107             {
108                 Source target = (Source) object;
109                 return target.getFormat();
110             }
111             public void setValue( java.lang.Object object, java.lang.Object value) 
112                 throws IllegalStateException, IllegalArgumentException
113             {
114                 try {
115                     Source target = (Source) object;
116                     target.setFormat( (java.lang.String) value);
117                 }
118                 catch (java.lang.Exception ex) {
119                     throw new IllegalStateException(ex.toString());
120                 }
121             }
122             public java.lang.Object newInstance( java.lang.Object parent ) {
123                 return null;
124             }
125         } );
126         desc.setHandler(handler);
127         addFieldDescriptor(desc);
128         
129         //-- validation code for: _format
130         fieldValidator = new org.exolab.castor.xml.FieldValidator();
131         { //-- local scope
132             StringValidator typeValidator = new StringValidator();
133             typeValidator.setWhiteSpace("preserve");
134             fieldValidator.setValidator(typeValidator);
135         }
136         desc.setValidator(fieldValidator);
137         //-- initialize element descriptors
138         
139     } //-- org.astrogrid.registry.beans.v10.resource.SourceDescriptor()
140 
141 
142       //-----------/
143      //- Methods -/
144     //-----------/
145 
146     /***
147      * Method getAccessMode
148      */
149     public org.exolab.castor.mapping.AccessMode getAccessMode()
150     {
151         return null;
152     } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 
153 
154     /***
155      * Method getExtends
156      */
157     public org.exolab.castor.mapping.ClassDescriptor getExtends()
158     {
159         return null;
160     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 
161 
162     /***
163      * Method getIdentity
164      */
165     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
166     {
167         return identity;
168     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 
169 
170     /***
171      * Method getJavaClass
172      */
173     public java.lang.Class getJavaClass()
174     {
175         return org.astrogrid.registry.beans.v10.resource.Source.class;
176     } //-- java.lang.Class getJavaClass() 
177 
178     /***
179      * Method getNameSpacePrefix
180      */
181     public java.lang.String getNameSpacePrefix()
182     {
183         return nsPrefix;
184     } //-- java.lang.String getNameSpacePrefix() 
185 
186     /***
187      * Method getNameSpaceURI
188      */
189     public java.lang.String getNameSpaceURI()
190     {
191         return nsURI;
192     } //-- java.lang.String getNameSpaceURI() 
193 
194     /***
195      * Method getValidator
196      */
197     public org.exolab.castor.xml.TypeValidator getValidator()
198     {
199         return this;
200     } //-- org.exolab.castor.xml.TypeValidator getValidator() 
201 
202     /***
203      * Method getXMLName
204      */
205     public java.lang.String getXMLName()
206     {
207         return xmlName;
208     } //-- java.lang.String getXMLName() 
209 
210 }