Clover icon

jalviewX

  1. Project Clover database Wed Oct 31 2018 15:13:58 GMT
  2. Package jalview.schemabinding.version2.descriptors

File AnnotationElementDescriptor.java

 

Coverage histogram

../../../../img/srcFileCovDistChart9.png
12% of files have more coverage

Code metrics

12
151
27
1
464
326
39
0.26
5.59
27
1.44

Classes

Class Line # Actions
AnnotationElementDescriptor 21 151 39 34
0.821052682.1%
 

Contributing tests

This file is covered by 14 tests. .

Source view

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.AnnotationElement;
15   
16    /**
17    * Class AnnotationElementDescriptor.
18    *
19    * @version $Revision$ $Date$
20    */
 
21    public class AnnotationElementDescriptor 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  128689 toggle public AnnotationElementDescriptor()
54    {
55  128689 super();
56  128689 _nsURI = "www.vamsas.ac.uk/jalview/version2";
57  128689 _xmlName = "annotationElement";
58  128689 _elementDefinition = true;
59   
60    // -- set grouping compositor
61  128689 setCompositorAsSequence();
62  128689 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
63  128689 org.exolab.castor.mapping.FieldHandler handler = null;
64  128689 org.exolab.castor.xml.FieldValidator fieldValidator = null;
65    // -- initialize attribute descriptors
66   
67    // -- _position
68  128689 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
69    java.lang.Integer.TYPE, "_position", "position",
70    org.exolab.castor.xml.NodeType.Attribute);
71  128689 handler = new org.exolab.castor.xml.XMLFieldHandler()
72    {
 
73  66326 toggle public java.lang.Object getValue(java.lang.Object object)
74    throws IllegalStateException
75    {
76  66326 AnnotationElement target = (AnnotationElement) object;
77  66326 if (!target.hasPosition())
78    {
79  0 return null;
80    }
81  66326 return new java.lang.Integer(target.getPosition());
82    }
83   
 
84  62363 toggle public void setValue(java.lang.Object object, java.lang.Object value)
85    throws IllegalStateException, IllegalArgumentException
86    {
87  62363 try
88    {
89  62363 AnnotationElement target = (AnnotationElement) object;
90    // ignore null values for non optional primitives
91  62363 if (value == null)
92    {
93  0 return;
94    }
95   
96  62363 target.setPosition(((java.lang.Integer) value).intValue());
97    } catch (java.lang.Exception ex)
98    {
99  0 throw new IllegalStateException(ex.toString());
100    }
101    }
102   
 
103  0 toggle public java.lang.Object newInstance(java.lang.Object parent)
104    {
105  0 return null;
106    }
107    };
108  128689 desc.setHandler(handler);
109  128689 desc.setRequired(true);
110  128689 desc.setMultivalued(false);
111  128689 addFieldDescriptor(desc);
112   
113    // -- validation code for: _position
114  128689 fieldValidator = new org.exolab.castor.xml.FieldValidator();
115  128689 fieldValidator.setMinOccurs(1);
116    { // -- local scope
117  128689 org.exolab.castor.xml.validators.IntValidator typeValidator;
118  128689 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
119  128689 fieldValidator.setValidator(typeValidator);
120  128689 typeValidator.setMinInclusive(-2147483648);
121  128689 typeValidator.setMaxInclusive(2147483647);
122    }
123  128689 desc.setValidator(fieldValidator);
124    // -- _colour
125  128689 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
126    java.lang.Integer.TYPE, "_colour", "colour",
127    org.exolab.castor.xml.NodeType.Attribute);
128  128689 handler = new org.exolab.castor.xml.XMLFieldHandler()
129    {
 
130  66326 toggle public java.lang.Object getValue(java.lang.Object object)
131    throws IllegalStateException
132    {
133  66326 AnnotationElement target = (AnnotationElement) object;
134  66326 if (!target.hasColour())
135    {
136  33686 return null;
137    }
138  32640 return new java.lang.Integer(target.getColour());
139    }
140   
 
141  33730 toggle public void setValue(java.lang.Object object, java.lang.Object value)
142    throws IllegalStateException, IllegalArgumentException
143    {
144  33730 try
145    {
146  33730 AnnotationElement target = (AnnotationElement) object;
147    // if null, use delete method for optional primitives
148  33730 if (value == null)
149    {
150  0 target.deleteColour();
151  0 return;
152    }
153  33730 target.setColour(((java.lang.Integer) value).intValue());
154    } catch (java.lang.Exception ex)
155    {
156  0 throw new IllegalStateException(ex.toString());
157    }
158    }
159   
 
160  0 toggle public java.lang.Object newInstance(java.lang.Object parent)
161    {
162  0 return null;
163    }
164    };
165  128689 desc.setHandler(handler);
166  128689 desc.setMultivalued(false);
167  128689 addFieldDescriptor(desc);
168   
169    // -- validation code for: _colour
170  128689 fieldValidator = new org.exolab.castor.xml.FieldValidator();
171    { // -- local scope
172  128689 org.exolab.castor.xml.validators.IntValidator typeValidator;
173  128689 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
174  128689 fieldValidator.setValidator(typeValidator);
175  128689 typeValidator.setMinInclusive(-2147483648);
176  128689 typeValidator.setMaxInclusive(2147483647);
177    }
178  128689 desc.setValidator(fieldValidator);
179    // -- initialize element descriptors
180   
181    // -- _displayCharacter
182  128689 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
183    java.lang.String.class, "_displayCharacter",
184    "displayCharacter", org.exolab.castor.xml.NodeType.Element);
185  128689 desc.setImmutable(true);
186  128689 handler = new org.exolab.castor.xml.XMLFieldHandler()
187    {
 
188  66326 toggle public java.lang.Object getValue(java.lang.Object object)
189    throws IllegalStateException
190    {
191  66326 AnnotationElement target = (AnnotationElement) object;
192  66326 return target.getDisplayCharacter();
193    }
194   
 
195  58866 toggle public void setValue(java.lang.Object object, java.lang.Object value)
196    throws IllegalStateException, IllegalArgumentException
197    {
198  58866 try
199    {
200  58866 AnnotationElement target = (AnnotationElement) object;
201  58866 target.setDisplayCharacter((java.lang.String) value);
202    } catch (java.lang.Exception ex)
203    {
204  0 throw new IllegalStateException(ex.toString());
205    }
206    }
207   
 
208  0 toggle public java.lang.Object newInstance(java.lang.Object parent)
209    {
210  0 return null;
211    }
212    };
213  128689 desc.setHandler(handler);
214  128689 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
215  128689 desc.setMultivalued(false);
216  128689 addFieldDescriptor(desc);
217   
218    // -- validation code for: _displayCharacter
219  128689 fieldValidator = new org.exolab.castor.xml.FieldValidator();
220    { // -- local scope
221  128689 org.exolab.castor.xml.validators.StringValidator typeValidator;
222  128689 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
223  128689 fieldValidator.setValidator(typeValidator);
224  128689 typeValidator.setWhiteSpace("preserve");
225    }
226  128689 desc.setValidator(fieldValidator);
227    // -- _description
228  128689 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
229    java.lang.String.class, "_description", "description",
230    org.exolab.castor.xml.NodeType.Element);
231  128689 desc.setImmutable(true);
232  128689 handler = new org.exolab.castor.xml.XMLFieldHandler()
233    {
 
234  66326 toggle public java.lang.Object getValue(java.lang.Object object)
235    throws IllegalStateException
236    {
237  66326 AnnotationElement target = (AnnotationElement) object;
238  66326 return target.getDescription();
239    }
240   
 
241  56334 toggle public void setValue(java.lang.Object object, java.lang.Object value)
242    throws IllegalStateException, IllegalArgumentException
243    {
244  56334 try
245    {
246  56334 AnnotationElement target = (AnnotationElement) object;
247  56334 target.setDescription((java.lang.String) value);
248    } catch (java.lang.Exception ex)
249    {
250  0 throw new IllegalStateException(ex.toString());
251    }
252    }
253   
 
254  0 toggle public java.lang.Object newInstance(java.lang.Object parent)
255    {
256  0 return null;
257    }
258    };
259  128689 desc.setHandler(handler);
260  128689 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
261  128689 desc.setMultivalued(false);
262  128689 addFieldDescriptor(desc);
263   
264    // -- validation code for: _description
265  128689 fieldValidator = new org.exolab.castor.xml.FieldValidator();
266    { // -- local scope
267  128689 org.exolab.castor.xml.validators.StringValidator typeValidator;
268  128689 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
269  128689 fieldValidator.setValidator(typeValidator);
270  128689 typeValidator.setWhiteSpace("preserve");
271    }
272  128689 desc.setValidator(fieldValidator);
273    // -- _secondaryStructure
274  128689 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
275    java.lang.String.class, "_secondaryStructure",
276    "secondaryStructure", org.exolab.castor.xml.NodeType.Element);
277  128689 desc.setImmutable(true);
278  128689 handler = new org.exolab.castor.xml.XMLFieldHandler()
279    {
 
280  66326 toggle public java.lang.Object getValue(java.lang.Object object)
281    throws IllegalStateException
282    {
283  66326 AnnotationElement target = (AnnotationElement) object;
284  66326 return target.getSecondaryStructure();
285    }
286   
 
287  6788 toggle public void setValue(java.lang.Object object, java.lang.Object value)
288    throws IllegalStateException, IllegalArgumentException
289    {
290  6788 try
291    {
292  6788 AnnotationElement target = (AnnotationElement) object;
293  6788 target.setSecondaryStructure((java.lang.String) value);
294    } catch (java.lang.Exception ex)
295    {
296  0 throw new IllegalStateException(ex.toString());
297    }
298    }
299   
 
300  0 toggle public java.lang.Object newInstance(java.lang.Object parent)
301    {
302  0 return null;
303    }
304    };
305  128689 desc.setHandler(handler);
306  128689 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
307  128689 desc.setMultivalued(false);
308  128689 addFieldDescriptor(desc);
309   
310    // -- validation code for: _secondaryStructure
311  128689 fieldValidator = new org.exolab.castor.xml.FieldValidator();
312    { // -- local scope
313  128689 org.exolab.castor.xml.validators.StringValidator typeValidator;
314  128689 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
315  128689 fieldValidator.setValidator(typeValidator);
316  128689 typeValidator.setWhiteSpace("preserve");
317  128689 typeValidator.setLength(1);
318    }
319  128689 desc.setValidator(fieldValidator);
320    // -- _value
321  128689 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
322    java.lang.Float.TYPE, "_value", "value",
323    org.exolab.castor.xml.NodeType.Element);
324  128689 handler = new org.exolab.castor.xml.XMLFieldHandler()
325    {
 
326  66326 toggle public java.lang.Object getValue(java.lang.Object object)
327    throws IllegalStateException
328    {
329  66326 AnnotationElement target = (AnnotationElement) object;
330  66326 if (!target.hasValue())
331    {
332  2736 return null;
333    }
334  63590 return new java.lang.Float(target.getValue());
335    }
336   
 
337  60845 toggle public void setValue(java.lang.Object object, java.lang.Object value)
338    throws IllegalStateException, IllegalArgumentException
339    {
340  60845 try
341    {
342  60845 AnnotationElement target = (AnnotationElement) object;
343    // if null, use delete method for optional primitives
344  60845 if (value == null)
345    {
346  0 target.deleteValue();
347  0 return;
348    }
349  60845 target.setValue(((java.lang.Float) value).floatValue());
350    } catch (java.lang.Exception ex)
351    {
352  0 throw new IllegalStateException(ex.toString());
353    }
354    }
355   
 
356  0 toggle public java.lang.Object newInstance(java.lang.Object parent)
357    {
358  0 return null;
359    }
360    };
361  128689 desc.setHandler(handler);
362  128689 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
363  128689 desc.setMultivalued(false);
364  128689 addFieldDescriptor(desc);
365   
366    // -- validation code for: _value
367  128689 fieldValidator = new org.exolab.castor.xml.FieldValidator();
368    { // -- local scope
369  128689 org.exolab.castor.xml.validators.FloatValidator typeValidator;
370  128689 typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
371  128689 fieldValidator.setValidator(typeValidator);
372  128689 typeValidator.setMinInclusive((float) -3.4028235E38);
373  128689 typeValidator.setMaxInclusive((float) 3.4028235E38);
374    }
375  128689 desc.setValidator(fieldValidator);
376    }
377   
378    // -----------/
379    // - Methods -/
380    // -----------/
381   
382    /**
383    * Method getAccessMode.
384    *
385    * @return the access mode specified for this class.
386    */
 
387  0 toggle public org.exolab.castor.mapping.AccessMode getAccessMode()
388    {
389  0 return null;
390    }
391   
392    /**
393    * Method getIdentity.
394    *
395    * @return the identity field, null if this class has no identity.
396    */
 
397  312089 toggle public org.exolab.castor.mapping.FieldDescriptor getIdentity()
398    {
399  312089 return super.getIdentity();
400    }
401   
402    /**
403    * Method getJavaClass.
404    *
405    * @return the Java class represented by this descriptor.
406    */
 
407  95526 toggle public java.lang.Class getJavaClass()
408    {
409  95526 return jalview.schemabinding.version2.AnnotationElement.class;
410    }
411   
412    /**
413    * Method getNameSpacePrefix.
414    *
415    * @return the namespace prefix to use when marshaling as XML.
416    */
 
417  33163 toggle public java.lang.String getNameSpacePrefix()
418    {
419  33163 return _nsPrefix;
420    }
421   
422    /**
423    * Method getNameSpaceURI.
424    *
425    * @return the namespace URI used when marshaling and unmarshaling as XML.
426    */
 
427  0 toggle public java.lang.String getNameSpaceURI()
428    {
429  0 return _nsURI;
430    }
431   
432    /**
433    * Method getValidator.
434    *
435    * @return a specific validator for the class described by this
436    * ClassDescriptor.
437    */
 
438  33163 toggle public org.exolab.castor.xml.TypeValidator getValidator()
439    {
440  33163 return this;
441    }
442   
443    /**
444    * Method getXMLName.
445    *
446    * @return the XML Name for the Class being described.
447    */
 
448  257378 toggle public java.lang.String getXMLName()
449    {
450  257378 return _xmlName;
451    }
452   
453    /**
454    * Method isElementDefinition.
455    *
456    * @return true if XML schema definition of this Class is that of a global
457    * element or element with anonymous type definition.
458    */
 
459  0 toggle public boolean isElementDefinition()
460    {
461  0 return _elementDefinition;
462    }
463   
464    }