|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.cli.CommandLine
public class CommandLine
Represents list of arguments parsed against a Options
descriptor.
It allows querying of a boolean hasOption(String opt)
,
in addition to retrieving the getOptionValue(String opt)
for options requiring arguments.
Additionally, any left-over or unrecognized arguments, are available for further processing.
Method Summary | |
---|---|
List |
getArgList()
Retrieve any left-over non-recognized options and arguments |
String[] |
getArgs()
Retrieve any left-over non-recognized options and arguments |
Object |
getOptionObject(char opt)
Return the Object type of this Option . |
Object |
getOptionObject(String opt)
Deprecated. due to System.err message. Instead use getParsedOptionValue(String) |
Properties |
getOptionProperties(String opt)
Retrieve the map of values associated to the option. |
Option[] |
getOptions()
Returns an array of the processed Option s. |
String |
getOptionValue(char opt)
Retrieve the argument, if any, of this option. |
String |
getOptionValue(char opt,
String defaultValue)
Retrieve the argument, if any, of an option. |
String |
getOptionValue(String opt)
Retrieve the argument, if any, of this option. |
String |
getOptionValue(String opt,
String defaultValue)
Retrieve the argument, if any, of an option. |
String[] |
getOptionValues(char opt)
Retrieves the array of values, if any, of an option. |
String[] |
getOptionValues(String opt)
Retrieves the array of values, if any, of an option. |
Object |
getParsedOptionValue(String opt)
Return a version of this Option converted to a particular type. |
boolean |
hasOption(char opt)
Query to see if an option has been set. |
boolean |
hasOption(String opt)
Query to see if an option has been set. |
Iterator |
iterator()
Returns an iterator over the Option members of CommandLine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean hasOption(String opt)
opt
- Short name of the option
public boolean hasOption(char opt)
opt
- character name of the option
public Object getOptionObject(String opt)
Object
type of this Option
.
opt
- the name of the option
Option
public Object getParsedOptionValue(String opt) throws ParseException
Option
converted to a particular type.
opt
- the name of the option
ParseException
- if there are problems turning the option value into the desired typePatternOptionBuilder
public Object getOptionObject(char opt)
Object
type of this Option
.
opt
- the name of the option
public String getOptionValue(String opt)
opt
- the name of the option
public String getOptionValue(char opt)
opt
- the character name of the option
public String[] getOptionValues(String opt)
opt
- string name of the option
public String[] getOptionValues(char opt)
opt
- character name of the option
public String getOptionValue(String opt, String defaultValue)
opt
- name of the optiondefaultValue
- is the default value to be returned if the option
is not specified
defaultValue
.public String getOptionValue(char opt, String defaultValue)
opt
- character name of the optiondefaultValue
- is the default value to be returned if the option
is not specified
defaultValue
.public Properties getOptionProperties(String opt)
opt
- name of the option
public String[] getArgs()
public List getArgList()
List
.public Iterator iterator()
Iterator
over the processed Option
members of this CommandLine
public Option[] getOptions()
Option
s.
Option
s.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |