public class SingletonCommandLineParser<T extends Configuration> extends CommandLineParser<T>
CommandLineParser.Command, CommandLineParser.ConfigBuilder<T extends Configuration>| Constructor and Description |
|---|
SingletonCommandLineParser(CommandLineParser.ConfigBuilder<T> builder)
Constructor for a
CommandLineParser with only one mode of operations. |
| Modifier and Type | Method and Description |
|---|---|
protected CommandLineParser.ConfigBuilder<T> |
getConfigBuilder(String firstParam)
Method that must be implemented retrieving the correct configBuilder given first argument
|
String |
help() |
T |
parse(String[] input)
Utility for parsing commandline parameters into configuration objects
|
public SingletonCommandLineParser(CommandLineParser.ConfigBuilder<T> builder)
CommandLineParser with only one mode of operations.builder - the singleton builderpublic T parse(String[] input) throws NoSuchBuilderException, WrongFormatException, UnknownCommandException
CommandLineParser
All commands parsable by the commandLineParser is of the form:
--mode --param1 -arg1 -arg2 --param2 --param3 -arg1
mode is what determines the CommandLineParser.ConfigBuilder used
Note that the first argument that the CommandLineParser.ConfigBuilder receives is always the mode argument.
The mode is also able to receive get arguments, however they wont affect choice of CommandLineParser.ConfigBuilder
Both commands and arguments are stripped of their "-" or "--" prefix
parse in class CommandLineParser<T extends Configuration>input - the string array to be parsedConfiguration created by the assigned CommandLineParser.ConfigBuilderNoSuchBuilderExceptionWrongFormatExceptionUnknownCommandExceptionprotected CommandLineParser.ConfigBuilder<T> getConfigBuilder(String firstParam)
CommandLineParsergetConfigBuilder in class CommandLineParser<T extends Configuration>firstParam - first argument from commandlineCommandLineParser.ConfigBuilder to be used in parsingpublic String help()
help in class CommandLineParser<T extends Configuration>Copyright © 2022. All rights reserved.