public class CommandLine extends Object
parseArgs(java.lang.String[])| Constructor and Description |
|---|
CommandLine()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addOption(String name,
BooleanVar var,
String helpText)
This addOption method allows you to add the definition of a flag option to the commandline.
|
void |
addOption(String name,
IntegerVar var,
String helpText)
This addOption method allows you to add the definition of an option that specifies a single integer.
|
void |
addOption(String name,
StringArrayList var,
String helpText)
This addOption method allows you to add the definition of an option that specifies a list of strings e.g.
|
void |
addOption(String name,
StringBuffer var,
String helpText)
This addOption method allows you to add the definition of an option that specifies a single string.
|
boolean |
optionFound(String name)
Checks whether the given option has been found in the command line.
|
boolean |
parseArgs(ResultSet rs,
String[] args)
Parses the argument vector and throws an exception if problems are found.
|
void |
parseArgs(String[] args)
Parses the argument vector and throws an exception if problems are found.
|
public void addOption(String name, BooleanVar var, String helpText)
name - the option name i.e. the part that follows the - (dash)var - the Boolean variable that stores the flag valuehelpText - text that describes the meaning of the flagpublic boolean optionFound(String name)
name - String the option namepublic void addOption(String name, StringArrayList var, String helpText)
name - the option name i.e. the part that follows the - (dash)var - the string array that stores the valueshelpText - text that describes the usage of the optionpublic void addOption(String name, StringBuffer var, String helpText)
name - the option name i.e. the part that follows the - (dash)var - the string that stores the valuehelpText - text that describes the usage of the optionpublic void addOption(String name, IntegerVar var, String helpText)
name - the option name i.e. the part that follows the - (dash)var - the string that stores the valuehelpText - text that describes the usage of the optionpublic void parseArgs(String[] args)
public boolean parseArgs(ResultSet rs, String[] args)
rs - Place to return errorsargs - The argument vector.Copyright © 2023. All rights reserved.