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