public class CmdlineGenericConsumer extends java.lang.Object implements CmdlineConsumer
| Constructor and Description |
|---|
CmdlineGenericConsumer() |
| Modifier and Type | Method and Description |
|---|---|
int |
checkKeyword(java.lang.String mainName,
int thisArg,
java.lang.String[] args)
Handle subclass-specific command line options and their arguments.
|
int |
checkOption(java.lang.String mainName,
char ch,
java.lang.String arg)
Handle subclass-specific command line options and their arguments.
|
boolean |
finalizeArgs(java.lang.String mainName)
Validate arguments after argument parsing has finished.
|
void |
initializeArgs()
Method used to initialize any instance variables which may be
changed by a cmdline option.
|
java.lang.String |
keywordUsage()
A short string included in the usage message to indicate
valid keywords.
|
java.lang.String |
optionUsage()
A short string included in the usage message to indicate
valid options.
|
public void initializeArgs()
CmdlineParser will be run
before any instance variables for the extending
class are initialized.initializeArgs in interface CmdlineConsumerpublic int checkOption(java.lang.String mainName,
char ch,
java.lang.String arg)
checkOption in interface CmdlineConsumermainName - The name of the main class (useful for
error messages.)ch - Option character. If -a is specified
on the command line, 'a' would be passed to
this method.)arg - The argument associated with this option.public java.lang.String optionUsage()
optionUsage in interface CmdlineConsumerpublic int checkKeyword(java.lang.String mainName,
int thisArg,
java.lang.String[] args)
checkKeyword in interface CmdlineConsumermainName - The name of the main class (useful for
error messages.)thisArg - The index of the current keyword.args - The full list of arguments.public java.lang.String keywordUsage()
keywordUsage in interface CmdlineConsumerpublic boolean finalizeArgs(java.lang.String mainName)
finalizeArgs in interface CmdlineConsumermainName - The name of the main class (useful for
error messages.)