1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
package jalview.schemabinding.version2.descriptors; |
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
import jalview.schemabinding.version2.Property; |
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
@version |
20 |
|
|
|
|
| 83.3% |
Uncovered Elements: 12 (72) |
Complexity: 17 |
Complexity Density: 0.3 |
|
21 |
|
public class PropertyDescriptor extends |
22 |
|
org.exolab.castor.xml.util.XMLClassDescriptorImpl |
23 |
|
{ |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
private boolean _elementDefinition; |
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
private java.lang.String _nsPrefix; |
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
private java.lang.String _nsURI; |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
private java.lang.String _xmlName; |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (35) |
Complexity: 1 |
Complexity Density: 0.03 |
|
53 |
114 |
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 |
|
|
63 |
|
|
64 |
|
|
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 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
71 |
76 |
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 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
78 |
38 |
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 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
91 |
0 |
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 |
|
|
102 |
114 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
103 |
114 |
fieldValidator.setMinOccurs(1); |
104 |
|
{ |
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 |
|
|
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 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
118 |
76 |
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 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
125 |
38 |
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 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
138 |
0 |
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 |
|
|
149 |
114 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
150 |
114 |
fieldValidator.setMinOccurs(1); |
151 |
|
{ |
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 |
|
|
159 |
|
|
160 |
|
} |
161 |
|
|
162 |
|
|
163 |
|
|
164 |
|
|
165 |
|
|
166 |
|
|
167 |
|
|
168 |
|
|
169 |
|
@return |
170 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
171 |
0 |
public org.exolab.castor.mapping.AccessMode getAccessMode()... |
172 |
|
{ |
173 |
0 |
return null; |
174 |
|
} |
175 |
|
|
176 |
|
|
177 |
|
|
178 |
|
|
179 |
|
@return |
180 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
181 |
114 |
public org.exolab.castor.mapping.FieldDescriptor getIdentity()... |
182 |
|
{ |
183 |
114 |
return super.getIdentity(); |
184 |
|
} |
185 |
|
|
186 |
|
|
187 |
|
|
188 |
|
|
189 |
|
@return |
190 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
191 |
76 |
public java.lang.Class getJavaClass()... |
192 |
|
{ |
193 |
76 |
return jalview.schemabinding.version2.Property.class; |
194 |
|
} |
195 |
|
|
196 |
|
|
197 |
|
|
198 |
|
|
199 |
|
@return |
200 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
201 |
38 |
public java.lang.String getNameSpacePrefix()... |
202 |
|
{ |
203 |
38 |
return _nsPrefix; |
204 |
|
} |
205 |
|
|
206 |
|
|
207 |
|
|
208 |
|
|
209 |
|
@return |
210 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
211 |
0 |
public java.lang.String getNameSpaceURI()... |
212 |
|
{ |
213 |
0 |
return _nsURI; |
214 |
|
} |
215 |
|
|
216 |
|
|
217 |
|
|
218 |
|
|
219 |
|
@return |
220 |
|
|
221 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
222 |
38 |
public org.exolab.castor.xml.TypeValidator getValidator()... |
223 |
|
{ |
224 |
38 |
return this; |
225 |
|
} |
226 |
|
|
227 |
|
|
228 |
|
|
229 |
|
|
230 |
|
@return |
231 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
232 |
228 |
public java.lang.String getXMLName()... |
233 |
|
{ |
234 |
228 |
return _xmlName; |
235 |
|
} |
236 |
|
|
237 |
|
|
238 |
|
|
239 |
|
|
240 |
|
@return |
241 |
|
|
242 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
243 |
0 |
public boolean isElementDefinition()... |
244 |
|
{ |
245 |
0 |
return _elementDefinition; |
246 |
|
} |
247 |
|
|
248 |
|
} |