2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3 * Copyright (C) 2014 The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package jalview.ws.jws2.dm;
21 import java.util.ArrayList;
22 import java.util.List;
24 import compbio.metadata.Option;
26 import jalview.ws.jws2.JabaParamStore;
27 import jalview.ws.params.ArgumentI;
28 import jalview.ws.params.WsParamSetI;
30 public class JabaWsParamSet implements WsParamSetI
35 List<Option> jabaArguments;
37 String name, description, applicableUrls[], sourceFile;
39 public JabaWsParamSet(String storeSetName, String descr, List jobParams)
41 if (jobParams.size() > 0)
43 if (jobParams.get(0) instanceof Option)
45 jabaArguments = new ArrayList<Option>();
46 // if classCastExceptions are raised then there has been an
47 // implementation error.
48 jabaArguments.addAll((List<Option>) jobParams);
52 if (!allJaba(jobParams))
55 "Cannot create a JabaWSParamSet from non-JabaWS parameters");
59 jabaArguments = JabaParamStore.getJabafromJwsArgs(jobParams);
66 applicableUrls = null;
69 public JabaWsParamSet()
74 private boolean allJaba(List jobParams)
77 boolean allJaba = true;
78 for (Object jp : jobParams)
80 if (jp instanceof JabaParameter || jp instanceof JabaOption)
94 public String getName()
100 public String getDescription()
109 public void setName(String name)
116 * the description to set
118 public void setDescription(String description)
120 this.description = description;
124 * @param applicableUrls
125 * the applicableUrls to set
127 public void setApplicableUrls(String[] applicableUrls)
129 this.applicableUrls = applicableUrls;
134 * the modifiable to set
136 public void setModifiable(boolean modifiable)
138 this.modifiable = modifiable;
142 public String[] getApplicableUrls()
144 return applicableUrls;
148 public String getSourceFile()
154 public void setSourceFile(String newfile)
156 sourceFile = newfile;
159 boolean modifiable = true;
162 public boolean isModifiable()
168 public List<ArgumentI> getArguments()
170 return JabaParamStore.getJwsArgsfromJaba(jabaArguments);
174 public void setArguments(List<ArgumentI> args)
179 "Cannot set arguments to a JabaWSParamSet that are not JabaWS arguments");
181 jabaArguments = new ArrayList<Option>();
182 for (ArgumentI rg : args)
184 jabaArguments.add(((JabaOption) rg).opt);
188 public List<Option> getjabaArguments()
190 return jabaArguments;
193 public void setjabaArguments(List<Option> args)
195 jabaArguments = args;