|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface CmdLineOption.Parameters
SPI for CmdLineOption
.
Object of this interface is passed to
CmdLineOption
s to make it easy/safe to parse
additional parameters for options.
Method Summary | |
---|---|
int |
getIntParameter(int idx)
The convenience method of Integer.parseInt(getParameter(idx))
with proper error handling. |
String |
getOptionName()
Gets the recognized option name. |
String |
getParameter(int idx)
Gets the additional parameter to this option. |
Method Detail |
---|
String getOptionName()
CmdLineOption.accepts(String)
method and
the method has returned true
.String getParameter(int idx) throws CmdLineException
idx
- specifying 0 will retrieve the token next to the option.
For example, if the command line looks like "-o abc -d x",
then getParameter(0)
for "-o" returns "abc"
and getParameter(1)
will return "-d".
CmdLineException
.
CmdLineException
int getIntParameter(int idx) throws CmdLineException
Integer.parseInt(getParameter(idx))
with proper error handling.
CmdLineException
- If the parameter is not an integer, it throws an
approrpiate CmdLineException
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |