|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.stanwood.media.cli.BaseLauncher
org.stanwood.media.cli.AbstractLauncher
public abstract class AbstractLauncher
This class should be extended by classes that have a main method used to lauch them from the command line. It helps with adding command line parameters and add some default CLI options.
Constructor Summary | |
---|---|
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 |
Method Summary | |
---|---|
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 |
Methods inherited from class org.stanwood.media.cli.BaseLauncher |
---|
addOption, checkSubCommand, displayHelp, doExit, fatal, fatal, getName, getOptions, getStderr, getStdout, handleBadSubCommandOption, info, init, launch, printOptions, printUsage, run, shouldDisplayHelp, warn |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.stanwood.media.cli.ICLICommand |
---|
getName |
Constructor Detail |
---|
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 handlerMethod Detail |
---|
protected abstract boolean processOptions(java.lang.String[] args, org.apache.commons.cli.CommandLine cmd)
AbstractLauncher
will already have been
validated sucesfully.
cmd
- The command line options
protected boolean processOptionsInternal(java.lang.String[] args, org.apache.commons.cli.CommandLine cmd)
processOptionsInternal
in class BaseLauncher
public Controller getController()
protected long parseLongOption(java.lang.String optionValue) throws org.apache.commons.cli.ParseException
java.util.Long
option fropm the command line
optionValue
- The command line parameter value
org.apache.commons.cli.ParseException
- Thrown if it could not be parsed correctlypublic static void setConfig(ConfigReader configReader)
configReader
- the config reader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |