+ // todo : check if replaceids should be a global for the service, rather
+ // than for a specific parameter.
+ if (min != 1)
+ {
+ prms.add("min='" + min + "'");
+ }
+ if (max != 0)
+ {
+ prms.add("max='" + max + "'");
+ }
+ }
+
+ public abstract List<OptionI> getOptions();
+
+ public List<OptionI> getBaseOptions()
+ {
+ ArrayList<OptionI> opts = new ArrayList<OptionI>();
+ opts.add(new IntegerParameter("min",
+ "Minimum number of data of this type", true, 1, min, 0, -1));
+ opts.add(new IntegerParameter("max",
+ "Maximum number of data of this type", false, 0, max, 0, -1));
+ return opts;
+ }
+
+ /**
+ * make a copy of this InputType
+ *
+ * @return may not be needed public abstract InputType copy();
+ */
+
+ /**
+ * parse a set of configuration options
+ *
+ * @param currentSettings
+ * - modified settings originally from getOptions
+ * @throws InvalidArgumentException
+ * thrown if currentSettings contains invalid options for this type.
+ */
+ public void configureFromArgumentI(List<ArgumentI> currentSettings)
+ throws InvalidArgumentException
+ {
+ ArrayList<String> urltoks = new ArrayList<String>();
+ String rg;
+ for (ArgumentI arg : currentSettings)
+ {
+ if (arg instanceof ParameterI)
+ {
+ rg = arg.getName() + "='" + arg.getValue() + "'";
+ }
+ else
+ {
+ // TODO: revise architecture - this is counter intuitive - options with
+ // different values to their names are actually parameters
+ rg = (arg.getValue().length() > 0)
+ ? (arg.getValue().equals(arg.getName()) ? arg.getName()
+ : arg.getName() + "='" + arg.getValue() + "'")
+ : arg.getName();
+ }
+ if (rg.length() > 0)
+ {
+ urltoks.add(rg);
+ }