Class SelectParamFactory

Object
SelectParamFactory

public class SelectParamFactory extends Object
Creates an appropriate SelectParam based upon the options passed to the command-line.
Author:
Owen Feehan
  • Method Details

    • useDefault

      public static SelectParam<Optional<Path>> useDefault()
      Creates a SelectParam 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 a SelectParam for a path, task name, or default.
      Parameters:
      line - the CommandLine to consider if certain options have been selected or not
      optionName - the option name to consider
      tasksDirectory - the path to the "tasks" directory in the anchor configuration files
      Returns:
      an appropriate SelectParam object
    • inputSelectParam

      public static SelectParam<Optional<Path>> inputSelectParam(org.apache.commons.cli.CommandLine line)
      Creates a SelectParam for input selection.

      Can point to either:

      1. a path ending in .xml, assumed to BeanXML for an input manager
      2. a directory, set as an the inputDirectory in the input-context
      3. a string with a wild-card, assumed to be a glob, set into the input-context as a glob
      4. a string with a period and without any forward or backwards slashes, set into the input-context as an extension to match
      Parameters:
      line - the CommandLine 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 a SelectParam for output selection.

      Can point to either:

      1. a path ending in .xml, assumed to BeanXML for an output manager
      2. a directory, set as the outputDirectory in the input-context
      Parameters:
      line - the CommandLine 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 a SelectParam for experiment selection.

      Can point to either:

      1. a path ending in .xml, assumed to BeanXML for an experiment
      2. nothing, then default experiment is used
      Parameters:
      line - the CommandLine to consider if certain options have been selected or not
      defaultExperiment - the path to the default experiment
      Returns:
      an appropriate SelectParam object
      Throws:
      ExperimentExecutionException - if there's an error creating the experiment select param