| java.lang.Object org.apache.commons.cli.CommandLine
Constructor Summary | |
| CommandLine() Creates a command line. |
Method Summary | |
void | addArg(String arg) Add left-over unrecognized option/argument. | void | addOption(Option opt) Add an option to the command line. | public List | getArgList() | public String[] | getArgs() | public Object | getOptionObject(String opt) Return the Object type of this Option . | public Object | getOptionObject(char opt) Return the Object type of this Option . | public String | getOptionValue(String opt) Retrieve the argument, if any, of this option. | public String | getOptionValue(char opt) Retrieve the argument, if any, of this option. | public String | getOptionValue(String opt, String defaultValue) Retrieve the argument, if any, of an option. | public String | getOptionValue(char opt, String defaultValue) Retrieve the argument, if any, of an option. | public String[] | getOptionValues(String opt) Retrieves the array of values, if any, of an option. | public String[] | getOptionValues(char opt) Retrieves the array of values, if any, of an option. | public Option[] | getOptions() Returns an array of the processed
Option s. | public boolean | hasOption(String opt) Query to see if an option has been set. | public boolean | hasOption(char opt) Query to see if an option has been set. | public Iterator | iterator() Returns an iterator over the Option members of CommandLine. |
CommandLine | CommandLine()(Code) | | Creates a command line.
|
addArg | void addArg(String arg)(Code) | | Add left-over unrecognized option/argument.
Parameters: arg - the unrecognised option/argument. |
addOption | void addOption(Option opt)(Code) | | Add an option to the command line. The values of
the option are stored.
Parameters: opt - the processed option |
getArgList | public List getArgList()(Code) | | Retrieve any left-over non-recognized options and arguments
remaining items passed in but not parsed as a List . |
getArgs | public String[] getArgs()(Code) | | Retrieve any left-over non-recognized options and arguments
remaining items passed in but not parsed as an array |
getOptionObject | public Object getOptionObject(String opt)(Code) | | Return the Object type of this Option .
Parameters: opt - the name of the option the type of this Option |
getOptionObject | public Object getOptionObject(char opt)(Code) | | Return the Object type of this Option .
Parameters: opt - the name of the option the type of opt |
getOptionValue | public String getOptionValue(String opt)(Code) | | Retrieve the argument, if any, of this option.
Parameters: opt - the name of the option Value of the argument if option is set, and has an argument,otherwise null. |
getOptionValue | public String getOptionValue(char opt)(Code) | | Retrieve the argument, if any, of this option.
Parameters: opt - the character name of the option Value of the argument if option is set, and has an argument,otherwise null. |
getOptionValue | public String getOptionValue(String opt, String defaultValue)(Code) | | Retrieve the argument, if any, of an option.
Parameters: opt - name of the option Parameters: defaultValue - is the default value to be returned if the option is not specified Value of the argument if option is set, and has an argument,otherwise defaultValue . |
getOptionValue | public String getOptionValue(char opt, String defaultValue)(Code) | | Retrieve the argument, if any, of an option.
Parameters: opt - character name of the option Parameters: defaultValue - is the default value to be returned if the option is not specified Value of the argument if option is set, and has an argument,otherwise defaultValue . |
getOptionValues | public String[] getOptionValues(String opt)(Code) | | Retrieves the array of values, if any, of an option.
Parameters: opt - string name of the option Values of the argument if option is set, and has an argument,otherwise null. |
getOptionValues | public String[] getOptionValues(char opt)(Code) | | Retrieves the array of values, if any, of an option.
Parameters: opt - character name of the option Values of the argument if option is set, and has an argument,otherwise null. |
getOptions | public Option[] getOptions()(Code) | | Returns an array of the processed
Option s.
an array of the processed Options. |
hasOption | public boolean hasOption(String opt)(Code) | | Query to see if an option has been set.
Parameters: opt - Short name of the option true if set, false if not |
hasOption | public boolean hasOption(char opt)(Code) | | Query to see if an option has been set.
Parameters: opt - character name of the option true if set, false if not |
iterator | public Iterator iterator()(Code) | | Returns an iterator over the Option members of CommandLine.
an Iterator over the processed Option members of this CommandLine |
|
|