Class SelectParamFactory
Object
SelectParamFactory
Creates an appropriate
SelectParam based upon the options passed to the command-line.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic SelectParam<Path> experimentSelectParam(org.apache.commons.cli.CommandLine line, Path defaultExperiment) Creates aSelectParamfor experiment selection.static SelectParam<Optional<Path>> inputSelectParam(org.apache.commons.cli.CommandLine line) Creates aSelectParamfor input selection.static SelectParam<Optional<Path>> outputSelectParam(org.apache.commons.cli.CommandLine line) Creates aSelectParamfor output selection.static SelectParam<Optional<Path>> pathOrTaskNameOrDefault(org.apache.commons.cli.CommandLine line, String optionName, Path tasksDirectory) Creates aSelectParamfor a path, task name, or default.static SelectParam<Optional<Path>> Creates aSelectParamthat uses the default manager.
-
Method Details
-
useDefault
Creates aSelectParamthat uses the default manager.- Returns:
- a
SelectParamthat uses the default path
-
pathOrTaskNameOrDefault
public static SelectParam<Optional<Path>> pathOrTaskNameOrDefault(org.apache.commons.cli.CommandLine line, String optionName, Path tasksDirectory) Creates aSelectParamfor a path, task name, or default.- Parameters:
line- theCommandLineto consider if certain options have been selected or notoptionName- the option name to considertasksDirectory- the path to the "tasks" directory in the anchor configuration files- Returns:
- an appropriate
SelectParamobject
-
inputSelectParam
Creates aSelectParamfor input selection.Can point to either:
- a path ending in .xml, assumed to BeanXML for an input manager
- a directory, set as an the inputDirectory in the input-context
- a string with a wild-card, assumed to be a glob, set into the input-context as a glob
- a string with a period and without any forward or backwards slashes, set into the input-context as an extension to match
- Parameters:
line- theCommandLineto consider if certain options have been selected or not- Returns:
- an appropriate
SelectParamobject
-
outputSelectParam
public static SelectParam<Optional<Path>> outputSelectParam(org.apache.commons.cli.CommandLine line) throws ExperimentExecutionException Creates aSelectParamfor output selection.Can point to either:
- a path ending in .xml, assumed to BeanXML for an output manager
- a directory, set as the outputDirectory in the input-context
- Parameters:
line- theCommandLineto consider if certain options have been selected or not- Returns:
- an appropriate
SelectParamobject - Throws:
ExperimentExecutionException- if both output options are present
-
experimentSelectParam
public static SelectParam<Path> experimentSelectParam(org.apache.commons.cli.CommandLine line, Path defaultExperiment) throws ExperimentExecutionException Creates aSelectParamfor experiment selection.Can point to either:
- a path ending in .xml, assumed to BeanXML for an experiment
- nothing, then default experiment is used
- Parameters:
line- theCommandLineto consider if certain options have been selected or notdefaultExperiment- the path to the default experiment- Returns:
- an appropriate
SelectParamobject - Throws:
ExperimentExecutionException- if there's an error creating the experiment select param
-