public class ArgumentProcessor extends Object
Constructor and Description |
---|
ArgumentProcessor(String progName)
Creates a new Argument processor instance for te program name given.
|
Modifier and Type | Method and Description |
---|---|
void |
addArgument(Argument arg)
Adds a new argument.
|
String |
getUsage()
Generates command line usage text for display to user.
|
ArgumentValues |
process(String[] programArgs)
Process the command line arguments provided.
|
void |
setUnknownArgumentHandler(UnknownArgumentHandler aHandler)
Sets the handler to call when an unknown argument is encountered.
|
public ArgumentProcessor(String progName)
progName
- program name used in usagepublic void addArgument(Argument arg)
arg
- argument to addpublic void setUnknownArgumentHandler(UnknownArgumentHandler aHandler)
aHandler
- unknown arg handler, or null to unsetpublic ArgumentValues process(String[] programArgs) throws UsageException
programArgs
- command line arguments supplied to programUsageException
- when usge suckedpublic String getUsage()