1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
package jalview.schemabinding.version2.descriptors; |
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
import jalview.schemabinding.version2.CompoundMatcher; |
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
@version |
20 |
|
|
|
|
| 79% |
Uncovered Elements: 17 (81) |
Complexity: 22 |
Complexity Density: 0.37 |
|
21 |
|
public class CompoundMatcherDescriptor |
22 |
|
extends 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 (29) |
Complexity: 1 |
Complexity Density: 0.03 |
|
53 |
14 |
public CompoundMatcherDescriptor()... |
54 |
|
{ |
55 |
14 |
super(); |
56 |
14 |
_xmlName = "compoundMatcher"; |
57 |
14 |
_elementDefinition = true; |
58 |
|
|
59 |
|
|
60 |
14 |
setCompositorAsSequence(); |
61 |
14 |
org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; |
62 |
14 |
org.exolab.castor.mapping.FieldHandler handler = null; |
63 |
14 |
org.exolab.castor.xml.FieldValidator fieldValidator = null; |
64 |
|
|
65 |
|
|
66 |
|
|
67 |
14 |
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( |
68 |
|
java.lang.Boolean.TYPE, "_and", "and", |
69 |
|
org.exolab.castor.xml.NodeType.Attribute); |
70 |
14 |
handler = new org.exolab.castor.xml.XMLFieldHandler() |
71 |
|
{ |
|
|
| 75% |
Uncovered Elements: 2 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
72 |
10 |
public java.lang.Object getValue(java.lang.Object object)... |
73 |
|
throws IllegalStateException |
74 |
|
{ |
75 |
10 |
CompoundMatcher target = (CompoundMatcher) object; |
76 |
10 |
if (!target.hasAnd()) |
77 |
|
{ |
78 |
0 |
return null; |
79 |
|
} |
80 |
10 |
return (target.getAnd() ? java.lang.Boolean.TRUE |
81 |
|
: java.lang.Boolean.FALSE); |
82 |
|
} |
83 |
|
|
|
|
| 62.5% |
Uncovered Elements: 3 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
84 |
4 |
public void setValue(java.lang.Object object, java.lang.Object value)... |
85 |
|
throws IllegalStateException, IllegalArgumentException |
86 |
|
{ |
87 |
4 |
try |
88 |
|
{ |
89 |
4 |
CompoundMatcher target = (CompoundMatcher) object; |
90 |
|
|
91 |
4 |
if (value == null) |
92 |
|
{ |
93 |
0 |
return; |
94 |
|
} |
95 |
|
|
96 |
4 |
target.setAnd(((java.lang.Boolean) value).booleanValue()); |
97 |
|
} catch (java.lang.Exception ex) |
98 |
|
{ |
99 |
0 |
throw new IllegalStateException(ex.toString()); |
100 |
|
} |
101 |
|
} |
102 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
103 |
0 |
public java.lang.Object newInstance(java.lang.Object parent)... |
104 |
|
{ |
105 |
0 |
return null; |
106 |
|
} |
107 |
|
}; |
108 |
14 |
desc.setHandler(handler); |
109 |
14 |
desc.setRequired(true); |
110 |
14 |
desc.setMultivalued(false); |
111 |
14 |
addFieldDescriptor(desc); |
112 |
|
|
113 |
|
|
114 |
14 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
115 |
14 |
fieldValidator.setMinOccurs(1); |
116 |
|
{ |
117 |
14 |
org.exolab.castor.xml.validators.BooleanValidator typeValidator; |
118 |
14 |
typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); |
119 |
14 |
fieldValidator.setValidator(typeValidator); |
120 |
|
} |
121 |
14 |
desc.setValidator(fieldValidator); |
122 |
|
|
123 |
|
|
124 |
|
|
125 |
14 |
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( |
126 |
|
jalview.schemabinding.version2.MatcherSet.class, |
127 |
|
"_matcherSetList", "matcherSet", |
128 |
|
org.exolab.castor.xml.NodeType.Element); |
129 |
14 |
handler = new org.exolab.castor.xml.XMLFieldHandler() |
130 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
131 |
10 |
public java.lang.Object getValue(java.lang.Object object)... |
132 |
|
throws IllegalStateException |
133 |
|
{ |
134 |
10 |
CompoundMatcher target = (CompoundMatcher) object; |
135 |
10 |
return target.getMatcherSet(); |
136 |
|
} |
137 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
138 |
8 |
public void setValue(java.lang.Object object, java.lang.Object value)... |
139 |
|
throws IllegalStateException, IllegalArgumentException |
140 |
|
{ |
141 |
8 |
try |
142 |
|
{ |
143 |
8 |
CompoundMatcher target = (CompoundMatcher) object; |
144 |
8 |
target.addMatcherSet( |
145 |
|
(jalview.schemabinding.version2.MatcherSet) value); |
146 |
|
} catch (java.lang.Exception ex) |
147 |
|
{ |
148 |
0 |
throw new IllegalStateException(ex.toString()); |
149 |
|
} |
150 |
|
} |
151 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
152 |
0 |
public void resetValue(Object object)... |
153 |
|
throws IllegalStateException, IllegalArgumentException |
154 |
|
{ |
155 |
0 |
try |
156 |
|
{ |
157 |
0 |
CompoundMatcher target = (CompoundMatcher) object; |
158 |
0 |
target.removeAllMatcherSet(); |
159 |
|
} catch (java.lang.Exception ex) |
160 |
|
{ |
161 |
0 |
throw new IllegalStateException(ex.toString()); |
162 |
|
} |
163 |
|
} |
164 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
165 |
8 |
public java.lang.Object newInstance(java.lang.Object parent)... |
166 |
|
{ |
167 |
8 |
return new jalview.schemabinding.version2.MatcherSet(); |
168 |
|
} |
169 |
|
}; |
170 |
14 |
desc.setHandler(handler); |
171 |
14 |
desc.setRequired(true); |
172 |
14 |
desc.setMultivalued(true); |
173 |
14 |
addFieldDescriptor(desc); |
174 |
|
|
175 |
|
|
176 |
14 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
177 |
14 |
fieldValidator.setMinOccurs(2); |
178 |
14 |
fieldValidator.setMaxOccurs(2); |
179 |
|
{ |
180 |
|
} |
181 |
14 |
desc.setValidator(fieldValidator); |
182 |
|
} |
183 |
|
|
184 |
|
|
185 |
|
|
186 |
|
|
187 |
|
|
188 |
|
|
189 |
|
|
190 |
|
|
191 |
|
@return |
192 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
193 |
0 |
public org.exolab.castor.mapping.AccessMode getAccessMode()... |
194 |
|
{ |
195 |
0 |
return null; |
196 |
|
} |
197 |
|
|
198 |
|
|
199 |
|
|
200 |
|
|
201 |
|
@return |
202 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
203 |
10 |
public org.exolab.castor.mapping.FieldDescriptor getIdentity()... |
204 |
|
{ |
205 |
10 |
return super.getIdentity(); |
206 |
|
} |
207 |
|
|
208 |
|
|
209 |
|
|
210 |
|
|
211 |
|
@return |
212 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
213 |
10 |
public java.lang.Class getJavaClass()... |
214 |
|
{ |
215 |
10 |
return jalview.schemabinding.version2.CompoundMatcher.class; |
216 |
|
} |
217 |
|
|
218 |
|
|
219 |
|
|
220 |
|
|
221 |
|
@return |
222 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
223 |
4 |
public java.lang.String getNameSpacePrefix()... |
224 |
|
{ |
225 |
4 |
return _nsPrefix; |
226 |
|
} |
227 |
|
|
228 |
|
|
229 |
|
|
230 |
|
|
231 |
|
@return |
232 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
233 |
4 |
public java.lang.String getNameSpaceURI()... |
234 |
|
{ |
235 |
4 |
return _nsURI; |
236 |
|
} |
237 |
|
|
238 |
|
|
239 |
|
|
240 |
|
|
241 |
|
@return |
242 |
|
|
243 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
244 |
6 |
public org.exolab.castor.xml.TypeValidator getValidator()... |
245 |
|
{ |
246 |
6 |
return this; |
247 |
|
} |
248 |
|
|
249 |
|
|
250 |
|
|
251 |
|
|
252 |
|
@return |
253 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
254 |
28 |
public java.lang.String getXMLName()... |
255 |
|
{ |
256 |
28 |
return _xmlName; |
257 |
|
} |
258 |
|
|
259 |
|
|
260 |
|
|
261 |
|
|
262 |
|
@return |
263 |
|
|
264 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
265 |
0 |
public boolean isElementDefinition()... |
266 |
|
{ |
267 |
0 |
return _elementDefinition; |
268 |
|
} |
269 |
|
|
270 |
|
} |