1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.fts.core; |
22 |
|
|
23 |
|
import java.io.BufferedReader; |
24 |
|
import java.io.IOException; |
25 |
|
import java.io.InputStream; |
26 |
|
import java.io.InputStreamReader; |
27 |
|
import java.util.ArrayList; |
28 |
|
import java.util.Collection; |
29 |
|
import java.util.HashMap; |
30 |
|
import java.util.Locale; |
31 |
|
import java.util.Objects; |
32 |
|
|
33 |
|
import jalview.fts.api.FTSDataColumnI; |
34 |
|
import jalview.fts.api.FTSDataColumnI.FTSDataColumnGroupI; |
35 |
|
import jalview.fts.api.FTSRestClientI; |
36 |
|
import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource; |
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
@author |
43 |
|
|
44 |
|
|
45 |
|
|
|
|
| 0% |
Uncovered Elements: 259 (259) |
Complexity: 105 |
Complexity Density: 0.62 |
|
46 |
|
public abstract class FTSRestClient implements FTSRestClientI |
47 |
|
{ |
48 |
|
protected Collection<FTSDataColumnI> dataColumns = new ArrayList<>(); |
49 |
|
|
50 |
|
protected Collection<FTSDataColumnGroupI> dataColumnGroups = new ArrayList<>(); |
51 |
|
|
52 |
|
protected Collection<FTSDataColumnI> searchableDataColumns = new ArrayList<>(); |
53 |
|
|
54 |
|
protected Collection<FTSDataColumnI> defaulDisplayedDataColumns = new ArrayList<>(); |
55 |
|
|
56 |
|
protected FTSDataColumnI primaryKeyColumn; |
57 |
|
|
58 |
|
private String primaryKeyColumnCode = null; |
59 |
|
|
60 |
|
private int defaultResponsePageSize = 100; |
61 |
|
|
62 |
|
protected HashMap<String, String> mockQueries = null; |
63 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
64 |
0 |
protected FTSRestClient()... |
65 |
|
{ |
66 |
|
|
67 |
|
} |
68 |
|
|
|
|
| 0% |
Uncovered Elements: 44 (44) |
Complexity: 14 |
Complexity Density: 0.5 |
|
69 |
0 |
public void parseDataColumnsConfigFile()... |
70 |
|
{ |
71 |
0 |
String fileName = getColumnDataConfigFileName(); |
72 |
|
|
73 |
0 |
InputStream in = getClass().getResourceAsStream(fileName); |
74 |
|
|
75 |
0 |
try (BufferedReader br = new BufferedReader(new InputStreamReader(in))) |
76 |
|
{ |
77 |
0 |
String line; |
78 |
0 |
while ((line = br.readLine()) != null) |
79 |
|
{ |
80 |
0 |
final String[] lineData = line.split(";"); |
81 |
0 |
try |
82 |
|
{ |
83 |
0 |
if (lineData.length == 2) |
84 |
|
{ |
85 |
0 |
if (lineData[0].equalsIgnoreCase("_data_column.primary_key")) |
86 |
|
{ |
87 |
0 |
primaryKeyColumnCode = lineData[1]; |
88 |
|
} |
89 |
0 |
if (lineData[0].equalsIgnoreCase( |
90 |
|
"_data_column.default_response_page_size")) |
91 |
|
{ |
92 |
0 |
defaultResponsePageSize = Integer.valueOf(lineData[1]); |
93 |
|
} |
94 |
|
} |
95 |
0 |
else if (lineData.length == 3) |
96 |
|
{ |
97 |
0 |
dataColumnGroups.add(new FTSDataColumnGroupI() |
98 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
99 |
0 |
@Override... |
100 |
|
public String getID() |
101 |
|
{ |
102 |
0 |
return lineData[0]; |
103 |
|
} |
104 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
105 |
0 |
@Override... |
106 |
|
public String getName() |
107 |
|
{ |
108 |
0 |
return lineData[1]; |
109 |
|
} |
110 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
111 |
0 |
@Override... |
112 |
|
public int getSortOrder() |
113 |
|
{ |
114 |
0 |
return Integer.valueOf(lineData[2]); |
115 |
|
} |
116 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
117 |
0 |
@Override... |
118 |
|
public String toString() |
119 |
|
{ |
120 |
0 |
return lineData[1]; |
121 |
|
} |
122 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
123 |
0 |
@Override... |
124 |
|
public int hashCode() |
125 |
|
{ |
126 |
0 |
return Objects.hash(this.getID(), this.getName(), |
127 |
|
this.getSortOrder()); |
128 |
|
} |
129 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
130 |
0 |
@Override... |
131 |
|
public boolean equals(Object otherObject) |
132 |
|
{ |
133 |
0 |
FTSDataColumnGroupI that = (FTSDataColumnGroupI) otherObject; |
134 |
0 |
return this.getID().equals(that.getID()) |
135 |
|
&& this.getName().equals(that.getName()) |
136 |
|
&& this.getSortOrder() == that.getSortOrder(); |
137 |
|
} |
138 |
|
}); |
139 |
|
} |
140 |
0 |
else if (lineData.length > 6) |
141 |
|
{ |
142 |
0 |
FTSDataColumnI dataCol = new FTSDataColumnI() |
143 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
144 |
0 |
@Override... |
145 |
|
public String toString() |
146 |
|
{ |
147 |
0 |
return getName(); |
148 |
|
} |
149 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
150 |
0 |
@Override... |
151 |
|
public String getName() |
152 |
|
{ |
153 |
0 |
return lineData[0]; |
154 |
|
} |
155 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
156 |
0 |
@Override... |
157 |
|
public String getCode() |
158 |
|
{ |
159 |
0 |
return lineData[1].split("\\|")[0]; |
160 |
|
} |
161 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
162 |
0 |
@Override... |
163 |
|
public String getAltCode() |
164 |
|
{ |
165 |
0 |
return lineData[1].split("\\|").length > 1 |
166 |
|
? lineData[1].split("\\|")[1] |
167 |
|
: getCode(); |
168 |
|
} |
169 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
170 |
0 |
@Override... |
171 |
|
public DataTypeI getDataType() |
172 |
|
{ |
173 |
0 |
final String[] dataTypeString = lineData[2].split("\\|"); |
174 |
0 |
final String classString = dataTypeString[0] |
175 |
|
.toUpperCase(Locale.ROOT); |
176 |
|
|
177 |
0 |
return new DataTypeI() |
178 |
|
{ |
179 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 7 |
Complexity Density: 0.7 |
|
180 |
0 |
@Override... |
181 |
|
public boolean isFormtted() |
182 |
|
{ |
183 |
0 |
if (dataTypeString.length > 1 |
184 |
|
&& dataTypeString[1] != null) |
185 |
|
{ |
186 |
0 |
switch (dataTypeString[1].toUpperCase(Locale.ROOT)) |
187 |
|
{ |
188 |
0 |
case "T": |
189 |
0 |
case "TRUE": |
190 |
0 |
return true; |
191 |
0 |
case "F": |
192 |
0 |
case "False": |
193 |
0 |
default: |
194 |
0 |
return false; |
195 |
|
} |
196 |
|
} |
197 |
0 |
return false; |
198 |
|
} |
199 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
200 |
0 |
@Override... |
201 |
|
public int getSignificantFigures() |
202 |
|
{ |
203 |
0 |
if (dataTypeString.length > 2 |
204 |
|
&& dataTypeString[2] != null) |
205 |
|
{ |
206 |
0 |
return Integer.valueOf(dataTypeString[2]); |
207 |
|
} |
208 |
0 |
return 0; |
209 |
|
} |
210 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 5 |
Complexity Density: 0.56 |
|
211 |
0 |
@Override... |
212 |
|
public Class getDataTypeClass() |
213 |
|
{ |
214 |
0 |
switch (classString) |
215 |
|
{ |
216 |
0 |
case "INT": |
217 |
0 |
case "INTEGER": |
218 |
0 |
return Integer.class; |
219 |
0 |
case "DOUBLE": |
220 |
0 |
return Double.class; |
221 |
0 |
case "STRING": |
222 |
0 |
default: |
223 |
0 |
return String.class; |
224 |
|
} |
225 |
|
} |
226 |
|
}; |
227 |
|
|
228 |
|
} |
229 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
230 |
0 |
@Override... |
231 |
|
public FTSDataColumnGroupI getGroup() |
232 |
|
{ |
233 |
0 |
FTSDataColumnGroupI group = null; |
234 |
0 |
try |
235 |
|
{ |
236 |
0 |
group = getDataColumnGroupById(lineData[3]); |
237 |
|
} catch (Exception e) |
238 |
|
{ |
239 |
0 |
e.printStackTrace(); |
240 |
|
} |
241 |
0 |
return group; |
242 |
|
} |
243 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
244 |
0 |
@Override... |
245 |
|
public int getMinWidth() |
246 |
|
{ |
247 |
0 |
return Integer.valueOf(lineData[4]); |
248 |
|
} |
249 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
250 |
0 |
@Override... |
251 |
|
public int getMaxWidth() |
252 |
|
{ |
253 |
0 |
return Integer.valueOf(lineData[5]); |
254 |
|
} |
255 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
256 |
0 |
@Override... |
257 |
|
public int getPreferredWidth() |
258 |
|
{ |
259 |
0 |
return Integer.valueOf(lineData[6]); |
260 |
|
} |
261 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
262 |
0 |
@Override... |
263 |
|
public boolean isPrimaryKeyColumn() |
264 |
|
{ |
265 |
0 |
return getName().equalsIgnoreCase(primaryKeyColumnCode) |
266 |
|
|| getCode().equalsIgnoreCase(primaryKeyColumnCode); |
267 |
|
} |
268 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
269 |
0 |
@Override... |
270 |
|
public boolean isVisibleByDefault() |
271 |
|
{ |
272 |
0 |
return Boolean.valueOf(lineData[7]); |
273 |
|
} |
274 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
275 |
0 |
@Override... |
276 |
|
public boolean isSearchable() |
277 |
|
{ |
278 |
0 |
return Boolean.valueOf(lineData[8]); |
279 |
|
} |
280 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
281 |
0 |
@Override... |
282 |
|
public int hashCode() |
283 |
|
{ |
284 |
0 |
return Objects.hash(this.getName(), this.getCode(), |
285 |
|
this.getGroup()); |
286 |
|
} |
287 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
288 |
0 |
@Override... |
289 |
|
public boolean equals(Object otherObject) |
290 |
|
{ |
291 |
0 |
FTSDataColumnI that = (FTSDataColumnI) otherObject; |
292 |
0 |
return otherObject == null ? false |
293 |
|
: this.getCode().equals(that.getCode()) |
294 |
|
&& this.getName().equals(that.getName()) |
295 |
|
&& this.getGroup().equals(that.getGroup()); |
296 |
|
} |
297 |
|
|
298 |
|
}; |
299 |
0 |
dataColumns.add(dataCol); |
300 |
|
|
301 |
0 |
if (dataCol.isSearchable()) |
302 |
|
{ |
303 |
0 |
searchableDataColumns.add(dataCol); |
304 |
|
} |
305 |
|
|
306 |
0 |
if (dataCol.isVisibleByDefault()) |
307 |
|
{ |
308 |
0 |
defaulDisplayedDataColumns.add(dataCol); |
309 |
|
} |
310 |
|
|
311 |
|
} |
312 |
|
else |
313 |
|
{ |
314 |
0 |
continue; |
315 |
|
} |
316 |
|
} catch (Exception e) |
317 |
|
{ |
318 |
0 |
e.printStackTrace(); |
319 |
|
} |
320 |
|
} |
321 |
0 |
try |
322 |
|
{ |
323 |
0 |
this.primaryKeyColumn = getDataColumnByNameOrCode( |
324 |
|
primaryKeyColumnCode); |
325 |
|
} catch (Exception e) |
326 |
|
{ |
327 |
0 |
e.printStackTrace(); |
328 |
|
} |
329 |
|
} catch (IOException e) |
330 |
|
{ |
331 |
0 |
e.printStackTrace(); |
332 |
|
} |
333 |
|
} |
334 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
335 |
0 |
@Override... |
336 |
|
public int getPrimaryKeyColumIndex( |
337 |
|
Collection<FTSDataColumnI> wantedFields, boolean hasRefSeq) |
338 |
|
throws Exception |
339 |
|
{ |
340 |
|
|
341 |
|
|
342 |
|
|
343 |
0 |
int pdbFieldIndexCounter = hasRefSeq ? 1 : 0; |
344 |
|
|
345 |
0 |
for (FTSDataColumnI field : wantedFields) |
346 |
|
{ |
347 |
0 |
if (field.isPrimaryKeyColumn()) |
348 |
|
{ |
349 |
0 |
break; |
350 |
|
} |
351 |
0 |
++pdbFieldIndexCounter; |
352 |
|
} |
353 |
0 |
return pdbFieldIndexCounter; |
354 |
|
} |
355 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 3 |
Complexity Density: 0.38 |
|
356 |
0 |
@Override... |
357 |
|
public String getDataColumnsFieldsAsCommaDelimitedString( |
358 |
|
Collection<FTSDataColumnI> dataColumnFields) |
359 |
|
{ |
360 |
0 |
String result = ""; |
361 |
0 |
if (dataColumnFields != null && !dataColumnFields.isEmpty()) |
362 |
|
{ |
363 |
0 |
StringBuilder returnedFields = new StringBuilder(); |
364 |
0 |
for (FTSDataColumnI field : dataColumnFields) |
365 |
|
{ |
366 |
0 |
returnedFields.append(",").append(field.getCode()); |
367 |
|
} |
368 |
0 |
returnedFields.deleteCharAt(0); |
369 |
0 |
result = returnedFields.toString(); |
370 |
|
} |
371 |
0 |
return result; |
372 |
|
} |
373 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
374 |
0 |
@Override... |
375 |
|
public Collection<FTSDataColumnI> getAllFTSDataColumns() |
376 |
|
{ |
377 |
0 |
if (dataColumns == null || dataColumns.isEmpty()) |
378 |
|
{ |
379 |
0 |
parseDataColumnsConfigFile(); |
380 |
|
} |
381 |
0 |
return dataColumns; |
382 |
|
} |
383 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
384 |
0 |
@Override... |
385 |
|
public Collection<FTSDataColumnI> getSearchableDataColumns() |
386 |
|
{ |
387 |
0 |
if (searchableDataColumns == null || searchableDataColumns.isEmpty()) |
388 |
|
{ |
389 |
0 |
parseDataColumnsConfigFile(); |
390 |
|
} |
391 |
0 |
return searchableDataColumns; |
392 |
|
} |
393 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
394 |
0 |
@Override... |
395 |
|
public Collection<FTSDataColumnI> getAllDefaultDisplayedFTSDataColumns() |
396 |
|
{ |
397 |
0 |
if (defaulDisplayedDataColumns == null |
398 |
|
|| defaulDisplayedDataColumns.isEmpty()) |
399 |
|
{ |
400 |
0 |
parseDataColumnsConfigFile(); |
401 |
|
} |
402 |
0 |
return defaulDisplayedDataColumns; |
403 |
|
} |
404 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
405 |
0 |
@Override... |
406 |
|
public FTSDataColumnI getPrimaryKeyColumn() |
407 |
|
{ |
408 |
0 |
if (defaulDisplayedDataColumns == null |
409 |
|
|| defaulDisplayedDataColumns.isEmpty()) |
410 |
|
{ |
411 |
0 |
parseDataColumnsConfigFile(); |
412 |
|
} |
413 |
0 |
return primaryKeyColumn; |
414 |
|
} |
415 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 5 |
Complexity Density: 0.83 |
|
416 |
0 |
@Override... |
417 |
|
public FTSDataColumnI getDataColumnByNameOrCode(String nameOrCode) |
418 |
|
throws Exception |
419 |
|
{ |
420 |
0 |
if (dataColumns == null || dataColumns.isEmpty()) |
421 |
|
{ |
422 |
0 |
parseDataColumnsConfigFile(); |
423 |
|
} |
424 |
0 |
for (FTSDataColumnI column : dataColumns) |
425 |
|
{ |
426 |
0 |
if (column.getName().equalsIgnoreCase(nameOrCode) |
427 |
|
|| column.getCode().equalsIgnoreCase(nameOrCode)) |
428 |
|
{ |
429 |
0 |
return column; |
430 |
|
} |
431 |
|
} |
432 |
0 |
throw new Exception( |
433 |
|
"Couldn't find data column with name : " + nameOrCode); |
434 |
|
} |
435 |
|
|
436 |
|
|
437 |
|
|
438 |
|
@param |
439 |
|
@param |
440 |
|
|
441 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
442 |
0 |
public static void createMockFTSRestClient(FTSRestClient instance,... |
443 |
|
String[][] mocks) |
444 |
|
{ |
445 |
0 |
instance.setMock(mocks); |
446 |
|
} |
447 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
448 |
0 |
@Override... |
449 |
|
public FTSDataColumnGroupI getDataColumnGroupById(String id) |
450 |
|
throws Exception |
451 |
|
{ |
452 |
0 |
if (dataColumns == null || dataColumns.isEmpty()) |
453 |
|
{ |
454 |
0 |
parseDataColumnsConfigFile(); |
455 |
|
} |
456 |
0 |
for (FTSDataColumnGroupI columnGroup : dataColumnGroups) |
457 |
|
{ |
458 |
0 |
if (columnGroup.getID().equalsIgnoreCase(id)) |
459 |
|
{ |
460 |
0 |
return columnGroup; |
461 |
|
} |
462 |
|
} |
463 |
0 |
throw new Exception("Couldn't find data column group with id : " + id); |
464 |
|
} |
465 |
|
|
|
|
| 0% |
Uncovered Elements: 27 (27) |
Complexity: 13 |
Complexity Density: 0.48 |
|
466 |
0 |
public static String getMessageByHTTPStatusCode(int code, String service)... |
467 |
|
{ |
468 |
0 |
String message = ""; |
469 |
0 |
switch (code) |
470 |
|
{ |
471 |
0 |
case 400: |
472 |
0 |
message = "Bad request. There is a problem with your input."; |
473 |
0 |
break; |
474 |
|
|
475 |
0 |
case 410: |
476 |
0 |
message = service + " rest services no longer available!"; |
477 |
0 |
break; |
478 |
0 |
case 403: |
479 |
0 |
case 404: |
480 |
0 |
message = "The requested resource could not be found"; |
481 |
0 |
break; |
482 |
0 |
case 408: |
483 |
0 |
case 409: |
484 |
0 |
case 500: |
485 |
0 |
case 501: |
486 |
0 |
case 502: |
487 |
0 |
case 504: |
488 |
0 |
case 505: |
489 |
0 |
message = "There seems to be an error from the " + service |
490 |
|
+ " server"; |
491 |
0 |
break; |
492 |
0 |
case 503: |
493 |
0 |
message = "Service not available. The server is being updated, try again later."; |
494 |
0 |
break; |
495 |
0 |
default: |
496 |
0 |
break; |
497 |
|
} |
498 |
0 |
return String.valueOf(code) + " " + message; |
499 |
|
} |
500 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
501 |
0 |
public static void unMock(FTSRestClient instance)... |
502 |
|
{ |
503 |
0 |
instance.mockQueries = null; |
504 |
|
} |
505 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
506 |
0 |
protected String getResourceFile(String fileName)... |
507 |
|
{ |
508 |
0 |
String result = ""; |
509 |
0 |
try |
510 |
|
{ |
511 |
0 |
result = getClass().getResource(fileName).getFile(); |
512 |
|
} catch (Exception e) |
513 |
|
{ |
514 |
0 |
e.printStackTrace(); |
515 |
|
} |
516 |
0 |
return result; |
517 |
|
|
518 |
|
} |
519 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
520 |
0 |
@Override... |
521 |
|
public int getDefaultResponsePageSize() |
522 |
|
{ |
523 |
0 |
if (dataColumns == null || dataColumns.isEmpty()) |
524 |
|
{ |
525 |
0 |
parseDataColumnsConfigFile(); |
526 |
|
} |
527 |
0 |
return defaultResponsePageSize; |
528 |
|
} |
529 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
530 |
0 |
protected void setMock(String[][] mocks)... |
531 |
|
{ |
532 |
0 |
if (mocks == null) |
533 |
|
{ |
534 |
0 |
mockQueries = null; |
535 |
0 |
return; |
536 |
|
} |
537 |
0 |
mockQueries = new HashMap<String, String>(); |
538 |
0 |
for (String[] mock : mocks) |
539 |
|
{ |
540 |
0 |
mockQueries.put(mock[0], mock[1]); |
541 |
|
} |
542 |
|
} |
543 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
544 |
0 |
protected boolean isMocked()... |
545 |
|
{ |
546 |
0 |
return mockQueries != null; |
547 |
|
} |
548 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.25 |
|
549 |
0 |
@Override... |
550 |
|
public String[] getPreferencesColumnsFor(PreferenceSource source) |
551 |
|
{ |
552 |
0 |
String[] columnNames = null; |
553 |
0 |
switch (source) |
554 |
|
{ |
555 |
0 |
case SEARCH_SUMMARY: |
556 |
0 |
columnNames = new String[] { "", "Display", "Group" }; |
557 |
0 |
break; |
558 |
0 |
default: |
559 |
|
|
560 |
|
|
561 |
0 |
break; |
562 |
|
} |
563 |
0 |
return columnNames; |
564 |
|
} |
565 |
|
} |