org.kohsuke.args4j
Interface CmdLineOption.Parameters

Enclosing interface:
CmdLineOption

public static interface CmdLineOption.Parameters

SPI for CmdLineOption. Object of this interface is passed to CmdLineOptions 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.
 java.lang.String getOptionName()
          Gets the recognized option name.
 java.lang.String getParameter(int idx)
          Gets the additional parameter to this option.
 

Method Detail

getOptionName

java.lang.String getOptionName()
Gets the recognized option name.

Returns:
This option name has been passed to the CmdLineOption.accepts(String) method and the method has returned true.

getParameter

java.lang.String getParameter(int idx)
                              throws CmdLineException
Gets the additional parameter to this option.

Parameters:
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".
Returns:
Always return non-null valid String. If an attempt is made to access a non-existent index, this method throws appropriate CmdLineException.
Throws:
CmdLineException

getIntParameter

int getIntParameter(int idx)
                    throws CmdLineException
The convenience method of Integer.parseInt(getParameter(idx)) with proper error handling.

Throws:
CmdLineException - If the parameter is not an integer, it throws an approrpiate CmdLineException.


Copyright © 2003-2011 Kohsuke Kawaguchi. All Rights Reserved.