Clover icon

jalviewX

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

File PropertyDescriptor.java

 

Coverage histogram

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

Code metrics

0
57
15
1
248
136
17
0.3
3.8
15
1.13

Classes

Class Line # Actions
PropertyDescriptor 21 57 17 12
0.833333383.3%
 

Contributing tests

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