1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.ws.jws2.dm; |
22 |
|
|
23 |
|
import java.net.MalformedURLException; |
24 |
|
import java.net.URL; |
25 |
|
import java.util.List; |
26 |
|
|
27 |
|
import compbio.metadata.Option; |
28 |
|
import jalview.util.MessageManager; |
29 |
|
import jalview.ws.jws2.ParameterUtils; |
30 |
|
import jalview.ws.params.OptionI; |
31 |
|
|
|
|
| 0% |
Uncovered Elements: 24 (24) |
Complexity: 13 |
Complexity Density: 0.93 |
|
32 |
|
public class JabaOption implements jalview.ws.params.OptionI |
33 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
34 |
0 |
public JabaOption(Option rg)... |
35 |
|
{ |
36 |
0 |
opt = rg; |
37 |
|
} |
38 |
|
|
39 |
|
Option opt; |
40 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
41 |
0 |
@Override... |
42 |
|
public String getValue() |
43 |
|
{ |
44 |
0 |
return opt.getDefaultValue(); |
45 |
|
} |
46 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
47 |
0 |
@Override... |
48 |
|
public String getName() |
49 |
|
{ |
50 |
0 |
return opt.getName(); |
51 |
|
} |
52 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 3 |
Complexity Density: 1 |
|
53 |
0 |
@Override... |
54 |
|
public URL getFurtherDetails() |
55 |
|
{ |
56 |
0 |
try |
57 |
|
{ |
58 |
0 |
return new URL(opt.getBasicURL().toExternalForm() + "/" |
59 |
|
+ opt.getFurtherDetails()); |
60 |
|
} catch (NullPointerException q) |
61 |
|
{ |
62 |
|
} catch (MalformedURLException q) |
63 |
|
{ |
64 |
|
|
65 |
|
} |
66 |
0 |
return null; |
67 |
|
} |
68 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
69 |
0 |
@Override... |
70 |
|
public boolean isRequired() |
71 |
|
{ |
72 |
0 |
return opt.isRequired(); |
73 |
|
} |
74 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
75 |
0 |
@Override... |
76 |
|
public String getDescription() |
77 |
|
{ |
78 |
0 |
return opt.getDescription(); |
79 |
|
} |
80 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
0 |
@Override... |
82 |
|
public List<String> getPossibleValues() |
83 |
|
{ |
84 |
|
|
85 |
0 |
return opt.getPossibleValues(); |
86 |
|
} |
87 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
88 |
0 |
@Override... |
89 |
|
public void setValue(String selectedItem) |
90 |
|
{ |
91 |
0 |
try |
92 |
|
{ |
93 |
0 |
opt.setDefaultValue(selectedItem); |
94 |
|
} catch (Exception e) |
95 |
|
{ |
96 |
0 |
throw new IllegalArgumentException(MessageManager |
97 |
|
.formatMessage("error.invalid_value_for_option", new String[] |
98 |
|
{ selectedItem, opt.getName() })); |
99 |
|
} |
100 |
|
} |
101 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
102 |
0 |
@Override... |
103 |
|
public OptionI copy() |
104 |
|
{ |
105 |
0 |
return new JabaOption(ParameterUtils.copyOption(opt)); |
106 |
|
} |
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
@return |
113 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
114 |
0 |
public Option getOption()... |
115 |
|
{ |
116 |
0 |
return opt; |
117 |
|
} |
118 |
|
|
119 |
|
} |