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 jalview.util.MessageManager; |
24 |
|
import jalview.ws.jws2.JabaParamStore; |
25 |
|
import jalview.ws.params.ArgumentI; |
26 |
|
import jalview.ws.params.WsParamSetI; |
27 |
|
|
28 |
|
import java.util.ArrayList; |
29 |
|
import java.util.List; |
30 |
|
|
31 |
|
import compbio.metadata.Option; |
32 |
|
|
|
|
| 0% |
Uncovered Elements: 63 (63) |
Complexity: 23 |
Complexity Density: 0.64 |
|
33 |
|
public class JabaWsParamSet implements WsParamSetI |
34 |
|
{ |
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
List<Option> jabaArguments; |
39 |
|
|
40 |
|
String name, description, applicableUrls[], sourceFile; |
41 |
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 4 |
Complexity Density: 0.36 |
|
42 |
0 |
public JabaWsParamSet(String storeSetName, String descr, List jobParams)... |
43 |
|
{ |
44 |
0 |
if (jobParams.size() > 0) |
45 |
|
{ |
46 |
0 |
if (jobParams.get(0) instanceof Option) |
47 |
|
{ |
48 |
0 |
jabaArguments = new ArrayList<Option>(); |
49 |
|
|
50 |
|
|
51 |
0 |
jabaArguments.addAll((List<Option>) jobParams); |
52 |
|
} |
53 |
|
else |
54 |
|
{ |
55 |
0 |
if (!allJaba(jobParams)) |
56 |
|
{ |
57 |
0 |
throw new Error(MessageManager |
58 |
|
.getString("error.cannot_create_jabaws_param_set")); |
59 |
|
} |
60 |
|
else |
61 |
|
{ |
62 |
0 |
jabaArguments = JabaParamStore.getJabafromJwsArgs(jobParams); |
63 |
|
} |
64 |
|
} |
65 |
|
} |
66 |
0 |
name = storeSetName; |
67 |
0 |
description = descr; |
68 |
0 |
sourceFile = null; |
69 |
0 |
applicableUrls = null; |
70 |
|
} |
71 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
72 |
0 |
public JabaWsParamSet()... |
73 |
|
{ |
74 |
|
|
75 |
|
} |
76 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.43 |
|
77 |
0 |
private boolean allJaba(List jobParams)... |
78 |
|
{ |
79 |
|
|
80 |
0 |
boolean allJaba = true; |
81 |
0 |
for (Object jp : jobParams) |
82 |
|
{ |
83 |
0 |
if (jp instanceof JabaParameter || jp instanceof JabaOption) |
84 |
|
{ |
85 |
0 |
allJaba &= true; |
86 |
|
} |
87 |
|
else |
88 |
|
{ |
89 |
0 |
allJaba = false; |
90 |
0 |
break; |
91 |
|
} |
92 |
|
} |
93 |
0 |
return allJaba; |
94 |
|
} |
95 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
96 |
0 |
@Override... |
97 |
|
public String getName() |
98 |
|
{ |
99 |
0 |
return name; |
100 |
|
} |
101 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
102 |
0 |
@Override... |
103 |
|
public String getDescription() |
104 |
|
{ |
105 |
0 |
return description; |
106 |
|
} |
107 |
|
|
108 |
|
|
109 |
|
@param |
110 |
|
|
111 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
112 |
0 |
public void setName(String name)... |
113 |
|
{ |
114 |
0 |
this.name = name; |
115 |
|
} |
116 |
|
|
117 |
|
|
118 |
|
@param |
119 |
|
|
120 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
121 |
0 |
public void setDescription(String description)... |
122 |
|
{ |
123 |
0 |
this.description = description; |
124 |
|
} |
125 |
|
|
126 |
|
|
127 |
|
@param |
128 |
|
|
129 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
130 |
0 |
public void setApplicableUrls(String[] applicableUrls)... |
131 |
|
{ |
132 |
0 |
this.applicableUrls = applicableUrls; |
133 |
|
} |
134 |
|
|
135 |
|
|
136 |
|
@param |
137 |
|
|
138 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
139 |
0 |
public void setModifiable(boolean modifiable)... |
140 |
|
{ |
141 |
0 |
this.modifiable = modifiable; |
142 |
|
} |
143 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
144 |
0 |
@Override... |
145 |
|
public String[] getApplicableUrls() |
146 |
|
{ |
147 |
0 |
return applicableUrls; |
148 |
|
} |
149 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
150 |
0 |
@Override... |
151 |
|
public String getSourceFile() |
152 |
|
{ |
153 |
0 |
return sourceFile; |
154 |
|
} |
155 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
156 |
0 |
@Override... |
157 |
|
public void setSourceFile(String newfile) |
158 |
|
{ |
159 |
0 |
sourceFile = newfile; |
160 |
|
} |
161 |
|
|
162 |
|
boolean modifiable = true; |
163 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
164 |
0 |
@Override... |
165 |
|
public boolean isModifiable() |
166 |
|
{ |
167 |
0 |
return modifiable; |
168 |
|
} |
169 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
170 |
0 |
@Override... |
171 |
|
public List<ArgumentI> getArguments() |
172 |
|
{ |
173 |
0 |
return JabaParamStore.getJwsArgsfromJaba(jabaArguments); |
174 |
|
} |
175 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
176 |
0 |
@Override... |
177 |
|
public void setArguments(List<ArgumentI> args) |
178 |
|
{ |
179 |
0 |
if (!allJaba(args)) |
180 |
|
{ |
181 |
0 |
throw new Error(MessageManager |
182 |
|
.getString("error.cannot_set_arguments_to_jabaws_param_set")); |
183 |
|
} |
184 |
0 |
jabaArguments = new ArrayList<Option>(); |
185 |
0 |
for (ArgumentI rg : args) |
186 |
|
{ |
187 |
0 |
jabaArguments.add(((JabaOption) rg).opt); |
188 |
|
} |
189 |
|
} |
190 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
191 |
0 |
public List<Option> getjabaArguments()... |
192 |
|
{ |
193 |
0 |
return jabaArguments; |
194 |
|
} |
195 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
196 |
0 |
public void setjabaArguments(List<Option> args)... |
197 |
|
{ |
198 |
0 |
jabaArguments = args; |
199 |
|
} |
200 |
|
|
201 |
|
} |