1 package jalview.ws.jws2.dm;
3 import java.io.BufferedReader;
4 import java.io.IOException;
7 import java.util.ArrayList;
10 import compbio.metadata.Argument;
11 import compbio.metadata.Option;
13 import jalview.ws.jws2.JabaParamStore;
14 import jalview.ws.jws2.ParameterUtils;
15 import jalview.ws.params.ArgumentI;
16 import jalview.ws.params.ParamDatastoreI;
17 import jalview.ws.params.WsParamSetI;
19 public class JabaWsParamSet implements WsParamSetI
24 List<Option> jabaArguments;
26 String name, description, applicableUrls[], sourceFile;
28 public JabaWsParamSet(String storeSetName, String descr, List jobParams)
30 if (jobParams.size() > 0)
32 if (jobParams.get(0) instanceof Option)
34 jabaArguments = new ArrayList<Option>();
35 // if classCastExceptions are raised then there has been an
36 // implementation error.
37 jabaArguments.addAll((List<Option>) jobParams);
41 if (!allJaba(jobParams))
44 "Cannot create a JabaWSParamSet from non-JabaWS parameters");
48 jabaArguments = JabaParamStore.getJabafromJwsArgs(jobParams);
55 applicableUrls = null;
58 public JabaWsParamSet()
63 private boolean allJaba(List jobParams)
66 boolean allJaba = true;
67 for (Object jp : jobParams)
69 if (jp instanceof JabaParameter || jp instanceof JabaOption)
83 public String getName()
89 public String getDescription()
98 public void setName(String name)
105 * the description to set
107 public void setDescription(String description)
109 this.description = description;
113 * @param applicableUrls
114 * the applicableUrls to set
116 public void setApplicableUrls(String[] applicableUrls)
118 this.applicableUrls = applicableUrls;
123 * the modifiable to set
125 public void setModifiable(boolean modifiable)
127 this.modifiable = modifiable;
131 public String[] getApplicableUrls()
133 return applicableUrls;
137 public String getSourceFile()
143 public void setSourceFile(String newfile)
145 sourceFile = newfile;
148 boolean modifiable = true;
151 public boolean isModifiable()
157 public List<ArgumentI> getArguments()
159 return JabaParamStore.getJwsArgsfromJaba(jabaArguments);
163 public void setArguments(List<ArgumentI> args)
168 "Cannot set arguments to a JabaWSParamSet that are not JabaWS arguments");
170 jabaArguments = new ArrayList<Option>();
171 for (ArgumentI rg : args)
173 jabaArguments.add(((JabaOption) rg).opt);
177 public List<Option> getjabaArguments()
179 return jabaArguments;
182 public void setjabaArguments(List<Option> args)
184 jabaArguments = args;