org.jargp
Class StringListDef

java.lang.Object
  extended by org.jargp.ParameterDef
      extended by org.jargp.StringListDef
Direct Known Subclasses:
NoFlagArgDef

public class StringListDef
extends ParameterDef

Command line string list parameter definition. This defines a command line flag with an associated string value which may be used repeatedly. The argument giving the parameter value must be the next unused argument from the command line following each occurrance of the flag, and must not begin with the '-' character used to indicate control argument flags.


Constructor Summary
StringListDef(char chr, java.lang.String name)
          Constructor without description.
StringListDef(char chr, java.lang.String name, java.lang.String desc)
          Constructor with description.
 
Method Summary
 void handle(ArgumentProcessor proc)
          Handle argument.
 
Methods inherited from class org.jargp.ParameterDef
getAbbreviation, getDescription, getFlag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringListDef

public StringListDef(char chr,
                     java.lang.String name,
                     java.lang.String desc)
Constructor with description.

Parameters:
chr - parameter flag character
name - field name for parameter
desc - discription text for parameter

StringListDef

public StringListDef(char chr,
                     java.lang.String name)
Constructor without description.

Parameters:
chr - parameter flag character
name - field name for parameter
Method Detail

handle

public void handle(ArgumentProcessor proc)
Handle argument. This implementation of the abstract base class method makes sure that we have another command line argument available, and checks that the argument does not begin with the '-' character used to indicate control argument flags. If these conditions are met the string value of the argument is added to the field list.

Specified by:
handle in class ParameterDef
Parameters:
proc - argument processor making call to handler
Throws:
ArgumentErrorException - if argument value missing or malformed
java.lang.IllegalArgumentException - on error in processing