public static interface CmdLineOption.Parameters
CmdLineOption
.
Object of this interface is passed to
CmdLineOption
s to make it easy/safe to parse
additional parameters for options.Modifier and Type | Method and Description |
---|---|
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.
|
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
.Copyright © 2003-2013 Kohsuke Kawaguchi. All Rights Reserved.