Clover icon

jalviewX

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

File FeatureDescriptor.java

 

Coverage histogram

../../../../img/srcFileCovDistChart8.png
19% of files have more coverage

Code metrics

12
188
34
1
564
414
49
0.26
5.53
34
1.44

Classes

Class Line # Actions
FeatureDescriptor 21 188 49 56
0.760683876.1%
 

Contributing tests

This file is covered by 9 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.Feature;
15   
16    /**
17    * Class FeatureDescriptor.
18    *
19    * @version $Revision$ $Date$
20    */
 
21    public class FeatureDescriptor 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  102628 toggle public FeatureDescriptor()
54    {
55  102628 super();
56  102628 _nsURI = "www.jalview.org";
57  102628 _xmlName = "feature";
58  102628 _elementDefinition = false;
59   
60    // -- set grouping compositor
61  102628 setCompositorAsSequence();
62  102628 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
63  102628 org.exolab.castor.mapping.FieldHandler handler = null;
64  102628 org.exolab.castor.xml.FieldValidator fieldValidator = null;
65    // -- initialize attribute descriptors
66   
67    // -- _begin
68  102628 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
69    java.lang.Integer.TYPE, "_begin", "begin",
70    org.exolab.castor.xml.NodeType.Attribute);
71  102628 handler = new org.exolab.castor.xml.XMLFieldHandler()
72    {
 
73  17776 toggle public java.lang.Object getValue(java.lang.Object object)
74    throws IllegalStateException
75    {
76  17776 Feature target = (Feature) object;
77  17776 if (!target.hasBegin())
78    {
79  0 return null;
80    }
81  17776 return new java.lang.Integer(target.getBegin());
82    }
83   
 
84  33538 toggle public void setValue(java.lang.Object object, java.lang.Object value)
85    throws IllegalStateException, IllegalArgumentException
86    {
87  33538 try
88    {
89  33538 Feature target = (Feature) object;
90    // ignore null values for non optional primitives
91  33538 if (value == null)
92    {
93  0 return;
94    }
95   
96  33538 target.setBegin(((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  102628 desc.setHandler(handler);
109  102628 desc.setRequired(true);
110  102628 desc.setMultivalued(false);
111  102628 addFieldDescriptor(desc);
112   
113    // -- validation code for: _begin
114  102628 fieldValidator = new org.exolab.castor.xml.FieldValidator();
115  102628 fieldValidator.setMinOccurs(1);
116    { // -- local scope
117  102628 org.exolab.castor.xml.validators.IntValidator typeValidator;
118  102628 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
119  102628 fieldValidator.setValidator(typeValidator);
120  102628 typeValidator.setMinInclusive(-2147483648);
121  102628 typeValidator.setMaxInclusive(2147483647);
122    }
123  102628 desc.setValidator(fieldValidator);
124    // -- _end
125  102628 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
126    java.lang.Integer.TYPE, "_end", "end",
127    org.exolab.castor.xml.NodeType.Attribute);
128  102628 handler = new org.exolab.castor.xml.XMLFieldHandler()
129    {
 
130  17776 toggle public java.lang.Object getValue(java.lang.Object object)
131    throws IllegalStateException
132    {
133  17776 Feature target = (Feature) object;
134  17776 if (!target.hasEnd())
135    {
136  0 return null;
137    }
138  17776 return new java.lang.Integer(target.getEnd());
139    }
140   
 
141  33538 toggle public void setValue(java.lang.Object object, java.lang.Object value)
142    throws IllegalStateException, IllegalArgumentException
143    {
144  33538 try
145    {
146  33538 Feature target = (Feature) object;
147    // ignore null values for non optional primitives
148  33538 if (value == null)
149    {
150  0 return;
151    }
152   
153  33538 target.setEnd(((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  102628 desc.setHandler(handler);
166  102628 desc.setRequired(true);
167  102628 desc.setMultivalued(false);
168  102628 addFieldDescriptor(desc);
169   
170    // -- validation code for: _end
171  102628 fieldValidator = new org.exolab.castor.xml.FieldValidator();
172  102628 fieldValidator.setMinOccurs(1);
173    { // -- local scope
174  102628 org.exolab.castor.xml.validators.IntValidator typeValidator;
175  102628 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
176  102628 fieldValidator.setValidator(typeValidator);
177  102628 typeValidator.setMinInclusive(-2147483648);
178  102628 typeValidator.setMaxInclusive(2147483647);
179    }
180  102628 desc.setValidator(fieldValidator);
181    // -- _type
182  102628 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
183    java.lang.String.class, "_type", "type",
184    org.exolab.castor.xml.NodeType.Attribute);
185  102628 desc.setImmutable(true);
186  102628 handler = new org.exolab.castor.xml.XMLFieldHandler()
187    {
 
188  17776 toggle public java.lang.Object getValue(java.lang.Object object)
189    throws IllegalStateException
190    {
191  17776 Feature target = (Feature) object;
192  17776 return target.getType();
193    }
194   
 
195  33538 toggle public void setValue(java.lang.Object object, java.lang.Object value)
196    throws IllegalStateException, IllegalArgumentException
197    {
198  33538 try
199    {
200  33538 Feature target = (Feature) object;
201  33538 target.setType((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  102628 desc.setHandler(handler);
214  102628 desc.setRequired(true);
215  102628 desc.setMultivalued(false);
216  102628 addFieldDescriptor(desc);
217   
218    // -- validation code for: _type
219  102628 fieldValidator = new org.exolab.castor.xml.FieldValidator();
220  102628 fieldValidator.setMinOccurs(1);
221    { // -- local scope
222  102628 org.exolab.castor.xml.validators.StringValidator typeValidator;
223  102628 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
224  102628 fieldValidator.setValidator(typeValidator);
225  102628 typeValidator.setWhiteSpace("preserve");
226    }
227  102628 desc.setValidator(fieldValidator);
228    // -- _description
229  102628 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
230    java.lang.String.class, "_description", "description",
231    org.exolab.castor.xml.NodeType.Attribute);
232  102628 desc.setImmutable(true);
233  102628 handler = new org.exolab.castor.xml.XMLFieldHandler()
234    {
 
235  17776 toggle public java.lang.Object getValue(java.lang.Object object)
236    throws IllegalStateException
237    {
238  17776 Feature target = (Feature) object;
239  17776 return target.getDescription();
240    }
241   
 
242  33538 toggle public void setValue(java.lang.Object object, java.lang.Object value)
243    throws IllegalStateException, IllegalArgumentException
244    {
245  33538 try
246    {
247  33538 Feature target = (Feature) object;
248  33538 target.setDescription((java.lang.String) value);
249    } catch (java.lang.Exception ex)
250    {
251  0 throw new IllegalStateException(ex.toString());
252    }
253    }
254   
 
255  0 toggle public java.lang.Object newInstance(java.lang.Object parent)
256    {
257  0 return null;
258    }
259    };
260  102628 desc.setHandler(handler);
261  102628 desc.setMultivalued(false);
262  102628 addFieldDescriptor(desc);
263   
264    // -- validation code for: _description
265  102628 fieldValidator = new org.exolab.castor.xml.FieldValidator();
266    { // -- local scope
267  102628 org.exolab.castor.xml.validators.StringValidator typeValidator;
268  102628 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
269  102628 fieldValidator.setValidator(typeValidator);
270  102628 typeValidator.setWhiteSpace("preserve");
271    }
272  102628 desc.setValidator(fieldValidator);
273    // -- _status
274  102628 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
275    java.lang.String.class, "_status", "status",
276    org.exolab.castor.xml.NodeType.Attribute);
277  102628 desc.setImmutable(true);
278  102628 handler = new org.exolab.castor.xml.XMLFieldHandler()
279    {
 
280  17776 toggle public java.lang.Object getValue(java.lang.Object object)
281    throws IllegalStateException
282    {
283  17776 Feature target = (Feature) object;
284  17776 return target.getStatus();
285    }
286   
 
287  0 toggle public void setValue(java.lang.Object object, java.lang.Object value)
288    throws IllegalStateException, IllegalArgumentException
289    {
290  0 try
291    {
292  0 Feature target = (Feature) object;
293  0 target.setStatus((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  102628 desc.setHandler(handler);
306  102628 desc.setMultivalued(false);
307  102628 addFieldDescriptor(desc);
308   
309    // -- validation code for: _status
310  102628 fieldValidator = new org.exolab.castor.xml.FieldValidator();
311    { // -- local scope
312  102628 org.exolab.castor.xml.validators.StringValidator typeValidator;
313  102628 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
314  102628 fieldValidator.setValidator(typeValidator);
315  102628 typeValidator.setWhiteSpace("preserve");
316    }
317  102628 desc.setValidator(fieldValidator);
318    // -- _featureGroup
319  102628 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
320    java.lang.String.class, "_featureGroup", "featureGroup",
321    org.exolab.castor.xml.NodeType.Attribute);
322  102628 desc.setImmutable(true);
323  102628 handler = new org.exolab.castor.xml.XMLFieldHandler()
324    {
 
325  17776 toggle public java.lang.Object getValue(java.lang.Object object)
326    throws IllegalStateException
327    {
328  17776 Feature target = (Feature) object;
329  17776 return target.getFeatureGroup();
330    }
331   
 
332  33538 toggle public void setValue(java.lang.Object object, java.lang.Object value)
333    throws IllegalStateException, IllegalArgumentException
334    {
335  33538 try
336    {
337  33538 Feature target = (Feature) object;
338  33538 target.setFeatureGroup((java.lang.String) value);
339    } catch (java.lang.Exception ex)
340    {
341  0 throw new IllegalStateException(ex.toString());
342    }
343    }
344   
 
345  0 toggle public java.lang.Object newInstance(java.lang.Object parent)
346    {
347  0 return null;
348    }
349    };
350  102628 desc.setHandler(handler);
351  102628 desc.setMultivalued(false);
352  102628 addFieldDescriptor(desc);
353   
354    // -- validation code for: _featureGroup
355  102628 fieldValidator = new org.exolab.castor.xml.FieldValidator();
356    { // -- local scope
357  102628 org.exolab.castor.xml.validators.StringValidator typeValidator;
358  102628 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
359  102628 fieldValidator.setValidator(typeValidator);
360  102628 typeValidator.setWhiteSpace("preserve");
361    }
362  102628 desc.setValidator(fieldValidator);
363    // -- _score
364  102628 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
365    java.lang.Float.TYPE, "_score", "score",
366    org.exolab.castor.xml.NodeType.Attribute);
367  102628 handler = new org.exolab.castor.xml.XMLFieldHandler()
368    {
 
369  17776 toggle public java.lang.Object getValue(java.lang.Object object)
370    throws IllegalStateException
371    {
372  17776 Feature target = (Feature) object;
373  17776 if (!target.hasScore())
374    {
375  0 return null;
376    }
377  17776 return new java.lang.Float(target.getScore());
378    }
379   
 
380  33538 toggle public void setValue(java.lang.Object object, java.lang.Object value)
381    throws IllegalStateException, IllegalArgumentException
382    {
383  33538 try
384    {
385  33538 Feature target = (Feature) object;
386    // if null, use delete method for optional primitives
387  33538 if (value == null)
388    {
389  0 target.deleteScore();
390  0 return;
391    }
392  33538 target.setScore(((java.lang.Float) value).floatValue());
393    } catch (java.lang.Exception ex)
394    {
395  0 throw new IllegalStateException(ex.toString());
396    }
397    }
398   
 
399  0 toggle public java.lang.Object newInstance(java.lang.Object parent)
400    {
401  0 return null;
402    }
403    };
404  102628 desc.setHandler(handler);
405  102628 desc.setMultivalued(false);
406  102628 addFieldDescriptor(desc);
407   
408    // -- validation code for: _score
409  102628 fieldValidator = new org.exolab.castor.xml.FieldValidator();
410    { // -- local scope
411  102628 org.exolab.castor.xml.validators.FloatValidator typeValidator;
412  102628 typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
413  102628 fieldValidator.setValidator(typeValidator);
414  102628 typeValidator.setMinInclusive((float) -3.4028235E38);
415  102628 typeValidator.setMaxInclusive((float) 3.4028235E38);
416    }
417  102628 desc.setValidator(fieldValidator);
418    // -- initialize element descriptors
419   
420    // -- _otherDataList
421  102628 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
422    jalview.schemabinding.version2.OtherData.class,
423    "_otherDataList", "otherData",
424    org.exolab.castor.xml.NodeType.Element);
425  102628 handler = new org.exolab.castor.xml.XMLFieldHandler()
426    {
 
427  17776 toggle public java.lang.Object getValue(java.lang.Object object)
428    throws IllegalStateException
429    {
430  17776 Feature target = (Feature) object;
431  17776 return target.getOtherData();
432    }
433   
 
434  22360 toggle public void setValue(java.lang.Object object, java.lang.Object value)
435    throws IllegalStateException, IllegalArgumentException
436    {
437  22360 try
438    {
439  22360 Feature target = (Feature) object;
440  22360 target.addOtherData((jalview.schemabinding.version2.OtherData) value);
441    } catch (java.lang.Exception ex)
442    {
443  0 throw new IllegalStateException(ex.toString());
444    }
445    }
446   
 
447  0 toggle public void resetValue(Object object) throws IllegalStateException,
448    IllegalArgumentException
449    {
450  0 try
451    {
452  0 Feature target = (Feature) object;
453  0 target.removeAllOtherData();
454    } catch (java.lang.Exception ex)
455    {
456  0 throw new IllegalStateException(ex.toString());
457    }
458    }
459   
 
460  22360 toggle public java.lang.Object newInstance(java.lang.Object parent)
461    {
462  22360 return new jalview.schemabinding.version2.OtherData();
463    }
464    };
465  102628 desc.setHandler(handler);
466  102628 desc.setNameSpaceURI("www.jalview.org");
467  102628 desc.setMultivalued(true);
468  102628 addFieldDescriptor(desc);
469   
470    // -- validation code for: _otherDataList
471  102628 fieldValidator = new org.exolab.castor.xml.FieldValidator();
472  102628 fieldValidator.setMinOccurs(0);
473    { // -- local scope
474    }
475  102628 desc.setValidator(fieldValidator);
476    }
477   
478    // -----------/
479    // - Methods -/
480    // -----------/
481   
482    /**
483    * Method getAccessMode.
484    *
485    * @return the access mode specified for this class.
486    */
 
487  0 toggle public org.exolab.castor.mapping.AccessMode getAccessMode()
488    {
489  0 return null;
490    }
491   
492    /**
493    * Method getIdentity.
494    *
495    * @return the identity field, null if this class has no identity.
496    */
 
497  219004 toggle public org.exolab.castor.mapping.FieldDescriptor getIdentity()
498    {
499  219004 return super.getIdentity();
500    }
501   
502    /**
503    * Method getJavaClass.
504    *
505    * @return the Java class represented by this descriptor.
506    */
 
507  8888 toggle public java.lang.Class getJavaClass()
508    {
509  8888 return jalview.schemabinding.version2.Feature.class;
510    }
511   
512    /**
513    * Method getNameSpacePrefix.
514    *
515    * @return the namespace prefix to use when marshaling as XML.
516    */
 
517  0 toggle public java.lang.String getNameSpacePrefix()
518    {
519  0 return _nsPrefix;
520    }
521   
522    /**
523    * Method getNameSpaceURI.
524    *
525    * @return the namespace URI used when marshaling and unmarshaling as XML.
526    */
 
527  0 toggle public java.lang.String getNameSpaceURI()
528    {
529  0 return _nsURI;
530    }
531   
532    /**
533    * Method getValidator.
534    *
535    * @return a specific validator for the class described by this
536    * ClassDescriptor.
537    */
 
538  0 toggle public org.exolab.castor.xml.TypeValidator getValidator()
539    {
540  0 return this;
541    }
542   
543    /**
544    * Method getXMLName.
545    *
546    * @return the XML Name for the Class being described.
547    */
 
548  0 toggle public java.lang.String getXMLName()
549    {
550  0 return _xmlName;
551    }
552   
553    /**
554    * Method isElementDefinition.
555    *
556    * @return true if XML schema definition of this Class is that of a global
557    * element or element with anonymous type definition.
558    */
 
559  0 toggle public boolean isElementDefinition()
560    {
561  0 return _elementDefinition;
562    }
563   
564    }