public final class CmdLineParser extends Object
| Constructor and Description |
|---|
CmdLineParser(Locale locale)
Constructor with locale.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copyToConfig(Config config)
Copy the parsed values to the configuration.
|
String |
get(String key)
Returns an option value by it's key.
|
static void |
main(String[] args)
Test method.
|
void |
parse(String[] args)
Parse the command line and set the values in the target config object.
|
void |
printUsage(OutputStream out)
Prints the command line usage.
|
void |
printUsage(PrintStream ps)
Prints the command line usage.
|
String |
remove(String key)
Removes an option key.
|
String |
toString() |
public CmdLineParser(Locale locale)
locale - Locale.public final void parse(String[] args) throws CmdLineException
args - Command line arguments.CmdLineException - Illegal arguments or missing required arguments.public String get(String key)
key - Key to find.null if the key was not found.public String remove(String key)
key - Option to remove.public void copyToConfig(Config config)
config - Config to fill with parsed values.public final void printUsage(PrintStream ps)
ps - Stream to use.public final void printUsage(OutputStream out)
out - Stream to use.public static void main(String[] args)
args - Not used.Copyright © 2013 Future Invent Informationsmanagement GmbH, Hamburg (Germany). All Rights Reserved.