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 aSelectParam
for experiment selection.static SelectParam
<Optional<Path>> inputSelectParam
(org.apache.commons.cli.CommandLine line) Creates aSelectParam
for input selection.static SelectParam
<Optional<Path>> outputSelectParam
(org.apache.commons.cli.CommandLine line) Creates aSelectParam
for output selection.static SelectParam
<Optional<Path>> pathOrTaskNameOrDefault
(org.apache.commons.cli.CommandLine line, String optionName, Path tasksDirectory) Creates aSelectParam
for a path, task name, or default.static SelectParam
<Optional<Path>> Creates aSelectParam
that uses the default manager.
-
Method Details
-
useDefault
Creates aSelectParam
that uses the default manager.- Returns:
- a
SelectParam
that uses the default path
-
pathOrTaskNameOrDefault
public static SelectParam<Optional<Path>> pathOrTaskNameOrDefault(org.apache.commons.cli.CommandLine line, String optionName, Path tasksDirectory) Creates aSelectParam
for a path, task name, or default.- Parameters:
line
- theCommandLine
to 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
SelectParam
object
-
inputSelectParam
Creates aSelectParam
for 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
- theCommandLine
to consider if certain options have been selected or not- Returns:
- an appropriate
SelectParam
object
-
outputSelectParam
public static SelectParam<Optional<Path>> outputSelectParam(org.apache.commons.cli.CommandLine line) throws ExperimentExecutionException Creates aSelectParam
for 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
- theCommandLine
to consider if certain options have been selected or not- Returns:
- an appropriate
SelectParam
object - 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 aSelectParam
for 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
- theCommandLine
to consider if certain options have been selected or notdefaultExperiment
- the path to the default experiment- Returns:
- an appropriate
SelectParam
object - Throws:
ExperimentExecutionException
- if there's an error creating the experiment select param
-