net.sf.statcvs.output

Class CommandLineParser


public class CommandLineParser
extends Object

Takes a command line, like given to the Main.main(String[]) method, and turns it into a ConfigurationOptions object.
Version:
$Id: CommandLineParser.java,v 1.26 2008/04/17 15:02:01 benoitx Exp $
Author:
Richard Cyganiak

Constructor Summary

CommandLineParser(String[] args)
Constructor for CommandLineParser

Method Summary

protected void
checkForRequiredArgs()
protected boolean
doChildrenSwitch(String s)
Give the argument to children classes that may have a way to recognise it.
protected int
getArgCount()
protected boolean
isArgsEmpty()
void
parse()
Parses the command line and sets the options (as static fields in ConfigurationOptions).
protected void
parseSwitch(String switchName)
protected String
popNextArg()

Constructor Details

CommandLineParser

public CommandLineParser(String[] args)
Constructor for CommandLineParser
Parameters:
args - the command line parameters

Method Details

checkForRequiredArgs

protected void checkForRequiredArgs()
            throws ConfigurationException

doChildrenSwitch

protected boolean doChildrenSwitch(String s)
            throws ConfigurationException
Give the argument to children classes that may have a way to recognise it.
Parameters:
s -
Returns:

getArgCount

protected int getArgCount()

isArgsEmpty

protected boolean isArgsEmpty()

parse

public void parse()
            throws ConfigurationException
Parses the command line and sets the options (as static fields in ConfigurationOptions).
Throws:
ConfigurationException - if errors are present on the command line

parseSwitch

protected void parseSwitch(String switchName)
            throws ConfigurationException

popNextArg

protected String popNextArg()