jcmdline
Interface CmdLineParser

All Known Implementing Classes:
PosixCmdLineParser

public interface CmdLineParser

Interface desribing the API used between the CmdLineHandler and its command line parser.

Implementations of this interface are intended to be passed to the constructor of a CmdLineHandler, which will then use the implementation to parse the command line to its composite elements.

Information on using CmdLineParsers can be found in the jcmdline User Guide.

Version:
jcmdline Rel. 2.0.0 $Id: CmdLineParser.java,v 1.2 2002/12/07 14:22:06 lglawrence Exp $
Author:
Lynne Lawrence

Method Summary
 UsageFormatter getUsageFormatter()
          Gets a usage formatter suitable for this CmdLineParser's format.
 void parse(java.lang.String[] clargs, java.util.Map<java.lang.String,Parameter<?>> opts, java.util.List<Parameter<?>> args)
          Parses the passed command line arguments into sets of options and arguments.
 void setUsageFormatter(UsageFormatter usageFormatter)
          Sets a usage formatter suitable for this CmdLineParser's format.
 

Method Detail

getUsageFormatter

UsageFormatter getUsageFormatter()
Gets a usage formatter suitable for this CmdLineParser's format.

Returns:
a usage formatter suitable for this CmdLineParser's format
See Also:
setUsageFormatter()

parse

void parse(java.lang.String[] clargs,
           java.util.Map<java.lang.String,Parameter<?>> opts,
           java.util.List<Parameter<?>> args)
           throws CmdLineException
Parses the passed command line arguments into sets of options and arguments. Following a call to this method, the appropriate values of the parameters and options will be set.

Parameters:
clargs - the command line arguments
opts - the expected command line options
args - the expected command line arguments (what is left on the command line after the options have been processed.
Throws:
CmdLineException - if the clargs fail to parse properly into the expected options and arguments.

setUsageFormatter

void setUsageFormatter(UsageFormatter usageFormatter)
Sets a usage formatter suitable for this CmdLineParser's format.

Parameters:
usageFormatter - a usage formatter suitable for this CmdLineParser's format
See Also:
getUsageFormatter()