public class SimpleCommandLineArguments extends Object
SimpleCommandLine command line tool.| Modifier and Type | Field and Description |
|---|---|
private boolean |
help
Help has been requested.
|
private String |
inFile
Provided input file name for the Spring configuration file.
|
private String |
logConfig
Name of a specific logging configuration, if one has been requested.
|
private List<String> |
otherArgs
Command-line arguments which are not part of options.
|
private String |
pipelineName
Provided name for the pipeline bean to execute.
|
private boolean |
quiet
Quiet logging has been requested.
|
private boolean |
verbose
Verbose logging has been requested.
|
| Constructor and Description |
|---|
SimpleCommandLineArguments() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
doHelp()
Indicates the presence of the
--help option. |
boolean |
doQuietOutput()
Indicates the presence of the
--quiet option. |
boolean |
doVerboseOutput()
Indicates the presence of the
--verbose option. |
private void |
errorAndExit(String error)
Prints the error message to STDERR and then exits.
|
String |
getInputFile()
Gets the parsed input file name from the command line.
|
String |
getLoggingConfiguration()
Gets the name of the requested logging configuration file
from the command line.
|
String |
getPipelineName()
Returns the name of the pipeline bean to execute from the command line.
|
void |
parseCommandLineArguments(String[] args)
Parse an array of command-line arguments as passed to the main program.
|
void |
printHelp(PrintStream out)
Print command line help instructions.
|
private void |
validateCommandLineArguments()
Validate the provided command line arguments, for example issuing
an error if they are inconsistent.
|
private boolean verbose
private boolean quiet
@Nullable private String logConfig
private boolean help
public void parseCommandLineArguments(String[] args)
args - array of command-line arguments to parse.@Nullable public String getInputFile()
@Nullable public String getPipelineName()
public boolean doVerboseOutput()
--verbose option.true if the user requested verbose logging.public boolean doQuietOutput()
--quiet option.true if the user requested quiet logging.@Nullable public String getLoggingConfiguration()
null.public boolean doHelp()
--help option.true if the user requested help.private void validateCommandLineArguments()
public void printHelp(PrintStream out)
out - location where to print the outputprivate void errorAndExit(String error)
error - the error messageCopyright © 1999–2015. All rights reserved.