JAL-892 schema changes (rnaViewer) for save Varna to project
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / SecondaryStructureDescriptor.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2.descriptors;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import jalview.schemabinding.version2.SecondaryStructure;
15
16 /**
17  * Class SecondaryStructureDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class SecondaryStructureDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
22
23
24       //--------------------------/
25      //- Class/Member Variables -/
26     //--------------------------/
27
28     /**
29      * Field _elementDefinition.
30      */
31     private boolean _elementDefinition;
32
33     /**
34      * Field _nsPrefix.
35      */
36     private java.lang.String _nsPrefix;
37
38     /**
39      * Field _nsURI.
40      */
41     private java.lang.String _nsURI;
42
43     /**
44      * Field _xmlName.
45      */
46     private java.lang.String _xmlName;
47
48
49       //----------------/
50      //- Constructors -/
51     //----------------/
52
53     public SecondaryStructureDescriptor() {
54         super();
55         _nsURI = "www.jalview.org";
56         _xmlName = "secondaryStructure";
57         _elementDefinition = true;
58         org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
59         org.exolab.castor.mapping.FieldHandler             handler        = null;
60         org.exolab.castor.xml.FieldValidator               fieldValidator = null;
61         //-- initialize attribute descriptors
62         
63         //-- _title
64         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", org.exolab.castor.xml.NodeType.Attribute);
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                 SecondaryStructure target = (SecondaryStructure) object;
71                 return target.getTitle();
72             }
73             public void setValue( java.lang.Object object, java.lang.Object value) 
74                 throws IllegalStateException, IllegalArgumentException
75             {
76                 try {
77                     SecondaryStructure target = (SecondaryStructure) object;
78                     target.setTitle( (java.lang.String) value);
79                 } catch (java.lang.Exception ex) {
80                     throw new IllegalStateException(ex.toString());
81                 }
82             }
83             public java.lang.Object newInstance(java.lang.Object parent) {
84                 return null;
85             }
86         };
87         desc.setHandler(handler);
88         desc.setMultivalued(false);
89         addFieldDescriptor(desc);
90         
91         //-- validation code for: _title
92         fieldValidator = new org.exolab.castor.xml.FieldValidator();
93         { //-- local scope
94             org.exolab.castor.xml.validators.StringValidator typeValidator;
95             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
96             fieldValidator.setValidator(typeValidator);
97             typeValidator.setWhiteSpace("preserve");
98         }
99         desc.setValidator(fieldValidator);
100         //-- _annotationId
101         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_annotationId", "annotationId", org.exolab.castor.xml.NodeType.Attribute);
102         desc.setImmutable(true);
103         handler = new org.exolab.castor.xml.XMLFieldHandler() {
104             public java.lang.Object getValue( java.lang.Object object ) 
105                 throws IllegalStateException
106             {
107                 SecondaryStructure target = (SecondaryStructure) object;
108                 return target.getAnnotationId();
109             }
110             public void setValue( java.lang.Object object, java.lang.Object value) 
111                 throws IllegalStateException, IllegalArgumentException
112             {
113                 try {
114                     SecondaryStructure target = (SecondaryStructure) object;
115                     target.setAnnotationId( (java.lang.String) value);
116                 } catch (java.lang.Exception ex) {
117                     throw new IllegalStateException(ex.toString());
118                 }
119             }
120             public java.lang.Object newInstance(java.lang.Object parent) {
121                 return null;
122             }
123         };
124         desc.setHandler(handler);
125         desc.setRequired(true);
126         desc.setMultivalued(false);
127         addFieldDescriptor(desc);
128         
129         //-- validation code for: _annotationId
130         fieldValidator = new org.exolab.castor.xml.FieldValidator();
131         fieldValidator.setMinOccurs(1);
132         { //-- local scope
133             org.exolab.castor.xml.validators.StringValidator typeValidator;
134             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
135             fieldValidator.setValidator(typeValidator);
136             typeValidator.setWhiteSpace("preserve");
137         }
138         desc.setValidator(fieldValidator);
139         //-- _gapped
140         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_gapped", "gapped", org.exolab.castor.xml.NodeType.Attribute);
141         handler = new org.exolab.castor.xml.XMLFieldHandler() {
142             public java.lang.Object getValue( java.lang.Object object ) 
143                 throws IllegalStateException
144             {
145                 SecondaryStructure target = (SecondaryStructure) object;
146                 if (!target.hasGapped()) { return null; }
147                 return (target.getGapped() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
148             }
149             public void setValue( java.lang.Object object, java.lang.Object value) 
150                 throws IllegalStateException, IllegalArgumentException
151             {
152                 try {
153                     SecondaryStructure target = (SecondaryStructure) object;
154                     // if null, use delete method for optional primitives 
155                     if (value == null) {
156                         target.deleteGapped();
157                         return;
158                     }
159                     target.setGapped( ((java.lang.Boolean) value).booleanValue());
160                 } catch (java.lang.Exception ex) {
161                     throw new IllegalStateException(ex.toString());
162                 }
163             }
164             public java.lang.Object newInstance(java.lang.Object parent) {
165                 return null;
166             }
167         };
168         desc.setHandler(handler);
169         desc.setMultivalued(false);
170         addFieldDescriptor(desc);
171         
172         //-- validation code for: _gapped
173         fieldValidator = new org.exolab.castor.xml.FieldValidator();
174         { //-- local scope
175             org.exolab.castor.xml.validators.BooleanValidator typeValidator;
176             typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
177             fieldValidator.setValidator(typeValidator);
178         }
179         desc.setValidator(fieldValidator);
180         //-- _viewerState
181         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_viewerState", "viewerState", org.exolab.castor.xml.NodeType.Attribute);
182         desc.setImmutable(true);
183         handler = new org.exolab.castor.xml.XMLFieldHandler() {
184             public java.lang.Object getValue( java.lang.Object object ) 
185                 throws IllegalStateException
186             {
187                 SecondaryStructure target = (SecondaryStructure) object;
188                 return target.getViewerState();
189             }
190             public void setValue( java.lang.Object object, java.lang.Object value) 
191                 throws IllegalStateException, IllegalArgumentException
192             {
193                 try {
194                     SecondaryStructure target = (SecondaryStructure) object;
195                     target.setViewerState( (java.lang.String) value);
196                 } catch (java.lang.Exception ex) {
197                     throw new IllegalStateException(ex.toString());
198                 }
199             }
200             public java.lang.Object newInstance(java.lang.Object parent) {
201                 return null;
202             }
203         };
204         desc.setHandler(handler);
205         desc.setMultivalued(false);
206         addFieldDescriptor(desc);
207         
208         //-- validation code for: _viewerState
209         fieldValidator = new org.exolab.castor.xml.FieldValidator();
210         { //-- local scope
211             org.exolab.castor.xml.validators.StringValidator typeValidator;
212             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
213             fieldValidator.setValidator(typeValidator);
214             typeValidator.setWhiteSpace("preserve");
215         }
216         desc.setValidator(fieldValidator);
217         //-- initialize element descriptors
218         
219     }
220
221
222       //-----------/
223      //- Methods -/
224     //-----------/
225
226     /**
227      * Method getAccessMode.
228      * 
229      * @return the access mode specified for this class.
230      */
231     public org.exolab.castor.mapping.AccessMode getAccessMode(
232     ) {
233         return null;
234     }
235
236     /**
237      * Method getIdentity.
238      * 
239      * @return the identity field, null if this class has no
240      * identity.
241      */
242     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
243     ) {
244         return super.getIdentity();
245     }
246
247     /**
248      * Method getJavaClass.
249      * 
250      * @return the Java class represented by this descriptor.
251      */
252     public java.lang.Class getJavaClass(
253     ) {
254         return jalview.schemabinding.version2.SecondaryStructure.class;
255     }
256
257     /**
258      * Method getNameSpacePrefix.
259      * 
260      * @return the namespace prefix to use when marshaling as XML.
261      */
262     public java.lang.String getNameSpacePrefix(
263     ) {
264         return _nsPrefix;
265     }
266
267     /**
268      * Method getNameSpaceURI.
269      * 
270      * @return the namespace URI used when marshaling and
271      * unmarshaling as XML.
272      */
273     public java.lang.String getNameSpaceURI(
274     ) {
275         return _nsURI;
276     }
277
278     /**
279      * Method getValidator.
280      * 
281      * @return a specific validator for the class described by this
282      * ClassDescriptor.
283      */
284     public org.exolab.castor.xml.TypeValidator getValidator(
285     ) {
286         return this;
287     }
288
289     /**
290      * Method getXMLName.
291      * 
292      * @return the XML Name for the Class being described.
293      */
294     public java.lang.String getXMLName(
295     ) {
296         return _xmlName;
297     }
298
299     /**
300      * Method isElementDefinition.
301      * 
302      * @return true if XML schema definition of this Class is that
303      * of a global
304      * element or element with anonymous type definition.
305      */
306     public boolean isElementDefinition(
307     ) {
308         return _elementDefinition;
309     }
310
311 }