Clover icon

jalviewX

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

File GroupDescriptor.java

 

Coverage histogram

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

Code metrics

6
59
15
1
257
143
20
0.34
3.93
15
1.33

Classes

Class Line # Actions
GroupDescriptor 21 59 20 16
0.880%
 

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.Group;
15   
16    /**
17    * Class GroupDescriptor.
18    *
19    * @version $Revision$ $Date$
20    */
 
21    public class GroupDescriptor 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  249 toggle public GroupDescriptor()
54    {
55  249 super();
56  249 _nsURI = "www.jalview.org";
57  249 _xmlName = "group";
58  249 _elementDefinition = true;
59  249 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
60  249 org.exolab.castor.mapping.FieldHandler handler = null;
61  249 org.exolab.castor.xml.FieldValidator fieldValidator = null;
62    // -- initialize attribute descriptors
63   
64    // -- _name
65  249 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
66    java.lang.String.class, "_name", "name",
67    org.exolab.castor.xml.NodeType.Attribute);
68  249 desc.setImmutable(true);
69  249 handler = new org.exolab.castor.xml.XMLFieldHandler()
70    {
 
71  66 toggle public java.lang.Object getValue(java.lang.Object object)
72    throws IllegalStateException
73    {
74  66 Group target = (Group) object;
75  66 return target.getName();
76    }
77   
 
78  183 toggle public void setValue(java.lang.Object object, java.lang.Object value)
79    throws IllegalStateException, IllegalArgumentException
80    {
81  183 try
82    {
83  183 Group target = (Group) object;
84  183 target.setName((java.lang.String) value);
85    } catch (java.lang.Exception ex)
86    {
87  0 throw new IllegalStateException(ex.toString());
88    }
89    }
90   
 
91  0 toggle public java.lang.Object newInstance(java.lang.Object parent)
92    {
93  0 return null;
94    }
95    };
96  249 desc.setHandler(handler);
97  249 desc.setRequired(true);
98  249 desc.setMultivalued(false);
99  249 addFieldDescriptor(desc);
100   
101    // -- validation code for: _name
102  249 fieldValidator = new org.exolab.castor.xml.FieldValidator();
103  249 fieldValidator.setMinOccurs(1);
104    { // -- local scope
105  249 org.exolab.castor.xml.validators.StringValidator typeValidator;
106  249 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
107  249 fieldValidator.setValidator(typeValidator);
108  249 typeValidator.setWhiteSpace("preserve");
109    }
110  249 desc.setValidator(fieldValidator);
111    // -- _display
112  249 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
113    java.lang.Boolean.TYPE, "_display", "display",
114    org.exolab.castor.xml.NodeType.Attribute);
115  249 handler = new org.exolab.castor.xml.XMLFieldHandler()
116    {
 
117  66 toggle public java.lang.Object getValue(java.lang.Object object)
118    throws IllegalStateException
119    {
120  66 Group target = (Group) object;
121  66 if (!target.hasDisplay())
122    {
123  0 return null;
124    }
125  66 return (target.getDisplay() ? java.lang.Boolean.TRUE
126    : java.lang.Boolean.FALSE);
127    }
128   
 
129  183 toggle public void setValue(java.lang.Object object, java.lang.Object value)
130    throws IllegalStateException, IllegalArgumentException
131    {
132  183 try
133    {
134  183 Group target = (Group) object;
135    // ignore null values for non optional primitives
136  183 if (value == null)
137    {
138  0 return;
139    }
140   
141  183 target.setDisplay(((java.lang.Boolean) value).booleanValue());
142    } catch (java.lang.Exception ex)
143    {
144  0 throw new IllegalStateException(ex.toString());
145    }
146    }
147   
 
148  0 toggle public java.lang.Object newInstance(java.lang.Object parent)
149    {
150  0 return null;
151    }
152    };
153  249 desc.setHandler(handler);
154  249 desc.setRequired(true);
155  249 desc.setMultivalued(false);
156  249 addFieldDescriptor(desc);
157   
158    // -- validation code for: _display
159  249 fieldValidator = new org.exolab.castor.xml.FieldValidator();
160  249 fieldValidator.setMinOccurs(1);
161    { // -- local scope
162  249 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
163  249 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
164  249 fieldValidator.setValidator(typeValidator);
165    }
166  249 desc.setValidator(fieldValidator);
167    // -- initialize element descriptors
168   
169    }
170   
171    // -----------/
172    // - Methods -/
173    // -----------/
174   
175    /**
176    * Method getAccessMode.
177    *
178    * @return the access mode specified for this class.
179    */
 
180  0 toggle public org.exolab.castor.mapping.AccessMode getAccessMode()
181    {
182  0 return null;
183    }
184   
185    /**
186    * Method getIdentity.
187    *
188    * @return the identity field, null if this class has no identity.
189    */
 
190  399 toggle public org.exolab.castor.mapping.FieldDescriptor getIdentity()
191    {
192  399 return super.getIdentity();
193    }
194   
195    /**
196    * Method getJavaClass.
197    *
198    * @return the Java class represented by this descriptor.
199    */
 
200  216 toggle public java.lang.Class getJavaClass()
201    {
202  216 return jalview.schemabinding.version2.Group.class;
203    }
204   
205    /**
206    * Method getNameSpacePrefix.
207    *
208    * @return the namespace prefix to use when marshaling as XML.
209    */
 
210  33 toggle public java.lang.String getNameSpacePrefix()
211    {
212  33 return _nsPrefix;
213    }
214   
215    /**
216    * Method getNameSpaceURI.
217    *
218    * @return the namespace URI used when marshaling and unmarshaling as XML.
219    */
 
220  0 toggle public java.lang.String getNameSpaceURI()
221    {
222  0 return _nsURI;
223    }
224   
225    /**
226    * Method getValidator.
227    *
228    * @return a specific validator for the class described by this
229    * ClassDescriptor.
230    */
 
231  33 toggle public org.exolab.castor.xml.TypeValidator getValidator()
232    {
233  33 return this;
234    }
235   
236    /**
237    * Method getXMLName.
238    *
239    * @return the XML Name for the Class being described.
240    */
 
241  498 toggle public java.lang.String getXMLName()
242    {
243  498 return _xmlName;
244    }
245   
246    /**
247    * Method isElementDefinition.
248    *
249    * @return true if XML schema definition of this Class is that of a global
250    * element or element with anonymous type definition.
251    */
 
252  0 toggle public boolean isElementDefinition()
253    {
254  0 return _elementDefinition;
255    }
256   
257    }