info.monitorenter.cpdetector
Class ACmdLineArgsInheritor

java.lang.Object
  extended by info.monitorenter.cpdetector.ACmdLineArgsInheritor
Direct Known Subclasses:
CodepageProcessor, PerformanceTest

public abstract class ACmdLineArgsInheritor
extends Object

Base class for inheritance of command line arguments.

Author:
Achim Westermann

Constructor Summary
ACmdLineArgsInheritor()
           
 
Method Summary
protected  void addCmdLineOption(String key, jargs.gnu.CmdLineParser.Option option)
          Subclasses have to call from their constructor and implant their desired options.
protected  Object getParsedCmdLineOption(String key)
          Returns the option value of a parsed command line option.
 void parseArgs(String[] cmdLineArgs)
           This method has to be called initially by the code using this instance in order to configure.
protected abstract  void usage()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ACmdLineArgsInheritor

public ACmdLineArgsInheritor()
Method Detail

addCmdLineOption

protected final void addCmdLineOption(String key,
                                      jargs.gnu.CmdLineParser.Option option)
Subclasses have to call from their constructor and implant their desired options. Later on they can retrieve those options by using method getParsedCmdLineOption(String key) and do whatever they desire with the value then contained within the option.

Parameters:
key - The same key as used for getParsedCmdLineOption(String key)

getParsedCmdLineOption

protected final Object getParsedCmdLineOption(String key)
                                       throws IllegalArgumentException
Returns the option value of a parsed command line option.

Throws:
IllegalArgumentException

parseArgs

public void parseArgs(String[] cmdLineArgs)
               throws Exception

This method has to be called initially by the code using this instance in order to configure.

Every subclass has to call super.parseArgs(cmdLineArgs) and then retrieve the options needed from the returned CmdLineParser!

Parameters:
cmdLineArgs -
Throws:
Exception

usage

protected abstract void usage()


Copyleft ㊢ 2003-2004 MPL 1.1, All Rights Footloose.