public abstract class AbstractLauncher extends BaseLauncher implements ICLICommand
Constructor and Description |
---|
AbstractLauncher(java.lang.String name,
java.util.List<org.apache.commons.cli.Option> options,
IExitHandler exitHandler,
java.io.PrintStream stdout,
java.io.PrintStream stderr)
Create a instance of the class
|
Modifier and Type | Method and Description |
---|---|
Controller |
getController()
Used to get the controller
|
protected long |
parseLongOption(java.lang.String optionValue)
Called to parse a
java.util.Long option fropm the command line |
protected abstract boolean |
processOptions(java.lang.String[] args,
org.apache.commons.cli.CommandLine cmd)
This is called to validate the tools CLI options.
|
protected boolean |
processOptionsInternal(java.lang.String[] args,
org.apache.commons.cli.CommandLine cmd) |
static void |
setConfig(ConfigReader configReader)
Used by tests to set the config reader
|
addOption, checkSubCommand, displayHelp, doExit, fatal, fatal, getName, getOptions, getStderr, getStdout, handleBadSubCommandOption, info, init, launch, printOptions, printUsage, run, shouldDisplayHelp, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
public AbstractLauncher(java.lang.String name, java.util.List<org.apache.commons.cli.Option> options, IExitHandler exitHandler, java.io.PrintStream stdout, java.io.PrintStream stderr)
name
- The name of the executableoptions
- The options that are to be added to the CLIstdout
- The standard output streamstderr
- The standard error streamexitHandler
- The exit handlerprotected abstract boolean processOptions(java.lang.String[] args, org.apache.commons.cli.CommandLine cmd)
AbstractLauncher
will already have been
validated sucesfully.cmd
- The command line optionsprotected boolean processOptionsInternal(java.lang.String[] args, org.apache.commons.cli.CommandLine cmd)
processOptionsInternal
in class BaseLauncher
public Controller getController()
getController
in interface ICLICommand
protected long parseLongOption(java.lang.String optionValue) throws org.apache.commons.cli.ParseException
java.util.Long
option fropm the command lineoptionValue
- The command line parameter valueorg.apache.commons.cli.ParseException
- Thrown if it could not be parsed correctlypublic static void setConfig(ConfigReader configReader)
configReader
- the config reader