org.jargp
Class ParameterDef

java.lang.Object
  extended by org.jargp.ParameterDef
Direct Known Subclasses:
BoolDef, FloatDef, IntDef, StringDef, StringListDef

public abstract class ParameterDef
extends java.lang.Object

Base class for command line parameter definitions. This is used for simple command line parameters of various flavors. Subclasses define the particular types of parameters supported.


Method Summary
 java.lang.String getAbbreviation()
          Get text abbreviation for parameter.
 java.lang.String getDescription()
          Get text of parameter description.
 char getFlag()
          Get flag character for parameter.
abstract  void handle(ArgumentProcessor proc)
          Handle argument.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAbbreviation

public java.lang.String getAbbreviation()
Get text abbreviation for parameter. The default format is just "-c", where 'c' is the flag character for the parameter. If a different format is needed by a subclass it should override this method.

Returns:
text abbreviation for showing parameter

getFlag

public char getFlag()
Get flag character for parameter.

Returns:
flag character specifying the parameter

getDescription

public java.lang.String getDescription()
Get text of parameter description.

Parameters:
file - file to be read
Returns:
array of bytes containing all data from file
Throws:
IOException - on file access error

handle

public abstract void handle(ArgumentProcessor proc)
Handle argument. This abstract method must be overridden in each subclass to perform the appropriate processing, if necessary using additional characters from the current argument or the next argument in the list.

Parameters:
proc - argument processor making call to handler