use of com.genericworkflownodes.knime.commandline.impl.CommandLineFile in project GenericKnimeNodes by genericworkflownodes.
the class CLICommandGenerator method handleNonListParameter.
private void handleNonListParameter(final List<List<? extends CommandLineElement>> extractedParameterValues, final Parameter<?> p) {
final List<CommandLineElement> l = new ArrayList<CommandLineElement>();
final CommandLineElement commandLineElement;
if (p instanceof FileParameter) {
commandLineElement = new CommandLineFile((FileParameter) p);
} else {
commandLineElement = new CommandLineParameter(p);
}
l.add(commandLineElement);
extractedParameterValues.add(l);
}
use of com.genericworkflownodes.knime.commandline.impl.CommandLineFile in project GenericKnimeNodes by genericworkflownodes.
the class CLICommandGenerator method handleListParameter.
private void handleListParameter(final List<List<? extends CommandLineElement>> extractedParameterValues, final ListParameter listParameter) {
final int nValues = listParameter.getStrings().size();
final String key = ((Parameter<?>) listParameter).getKey();
final List<CommandLineElement> tmpList = new LinkedList<CommandLineElement>();
// there's only one element in the list
if (nValues > 1) {
int sequence = 0;
for (final String value : listParameter.getStrings()) {
final CommandLineElement commandLineElement;
if (listParameter instanceof IFileParameter) {
commandLineElement = new CommandLineFile(new FileParameter(key, value));
} else {
commandLineElement = new CommandLineParameter(new StringParameter(key, value));
}
commandLineElement.setSequenceNumber(sequence++);
tmpList.add(commandLineElement);
}
} else {
// only one value in the list, no need to use sequence numbers
final String value = listParameter.getStrings().get(0);
if (listParameter instanceof IFileParameter) {
tmpList.add(new CommandLineFile(new FileParameter(key, value)));
} else {
tmpList.add(new CommandLineParameter(new StringParameter(key, value)));
}
}
extractedParameterValues.add(tmpList);
}
Aggregations