Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sf.statcvs.output
Class CommandLineParser

    java.lang.Object
      net.sf.statcvs.output.CommandLineParser

public class CommandLineParser
extends Object

Takes a command line, like given to the `Main.main(java.lang.String[])` method, and turns it into a `ConfigurationOptions` object.

Version:
  $Id: CommandLineParser.java,v 1.29 2009/08/19 22:11:15 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()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CommandLineParser

    public CommandLineParser(String[] args)

  Constructor for CommandLineParser

Parameters:
  `args` - the command line parameters

Method Detail

### 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

### popNextArg

    protected String popNextArg()

### parseSwitch

    protected void parseSwitch(String switchName)
                        throws ConfigurationException

  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:
  Throws:
    `ConfigurationException`

### checkForRequiredArgs

    protected void checkForRequiredArgs()
                                 throws ConfigurationException

  Throws:
    `ConfigurationException`

### getArgCount

    protected int getArgCount()

### isArgsEmpty

    protected boolean isArgsEmpty()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD