iaik.tc.utils.cmdline
Class SubCommandParser

Object
  extended by CommonParser
      extended by SubCommandParser

public class SubCommandParser
extends CommonParser


Constructor Summary
SubCommandParser()
           
 
Method Summary
 void addSubCmd(SubCommand subCmd)
          This method is used to add a new parameter that should be handled by the parser.
 void parse(String[] args)
          This method parses the given argument array.
 void printUsage()
          This method prints a usage message to standard out.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubCommandParser

public SubCommandParser()
Method Detail

parse

public void parse(String[] args)
           throws IllegalArgumentException
This method parses the given argument array. It basically takes a look at the first item and checks if it is a valid sub-command. If that is the case, it obtains the parameter parser of this sub-command and passes the remaining arguments to this parser. After the parameter parser has finished (and no exception has been thrown), the application corresponding to the sub-command is started.

Throws:
IllegalArgumentException

addSubCmd

public void addSubCmd(SubCommand subCmd)
This method is used to add a new parameter that should be handled by the parser.

Parameters:
subCmd - new command line parameter

printUsage

public void printUsage()
This method prints a usage message to standard out.