jimmc.util
Class OptionParser
java.lang.Object
|
+--jimmc.util.OptionParser
- public class OptionParser
- extends java.lang.Object
Parse options and arguments from an array of strings.
- See Also:
Option
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
options
protected java.util.Map options
- Our defined options.
res
protected ResourceSource res
- Our resource source.
OptionParser
public OptionParser(ResourceSource resourceSource)
- Create an option parser.
After this, the application typically calls
addOption(jimmc.util.Option)
for each defined option, then
parseOptions(java.lang.String[])
to parse the given options and execute
the action method of any specified option.
addOption
public void addOption(Option option)
- Define an option.
getOption
public Option getOption(java.lang.String name)
- Get an option given its name.
getOptionNames
public java.lang.String[] getOptionNames()
- Get the names of all options.
parseOptions
public void parseOptions(java.lang.String[] args)
- Parse the given options.