| java.lang.Object org.jargp.ParameterDef
All known Subclasses: org.jargp.FloatDef, org.jargp.BoolDef, org.jargp.StringListDef, org.jargp.IntDef, org.jargp.StringDef,
ParameterDef | abstract public class ParameterDef (Code) | | 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.
author: Dennis M. Sosnoski version: 1.0 |
Field Summary | |
final protected char | m_char Argument flag character. | final protected String | m_description Argument description text. | protected Field | m_field Information for field linked to parameter. | final protected String | m_name Name of field holding parameter value. |
m_char | final protected char m_char(Code) | | Argument flag character.
|
m_description | final protected String m_description(Code) | | Argument description text.
|
m_field | protected Field m_field(Code) | | Information for field linked to parameter.
|
m_name | final protected String m_name(Code) | | Name of field holding parameter value.
|
ParameterDef | protected ParameterDef(char chr, String name, String desc)(Code) | | Constructor
Parameters: chr - parameter flag character Parameters: name - field name for parameter Parameters: desc - discription text for parameter (may be null ) throws: IllegalArgumentException - if the field is not accessible |
bindToClass | protected void bindToClass(Class clas)(Code) | | Bind parameter to target class field. This will generally be overridden
by subclasses to verify the field type found, but should be called during
the subclass processing.
Parameters: clas - target class for saving parameter values |
getAbbreviation | public String getAbbreviation()(Code) | | 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.
text abbreviation for showing parameter |
getDescription | public String getDescription()(Code) | | Get text of parameter description.
Parameters: file - file to be read array of bytes containing all data from file throws: IOException - on file access error |
getFlag | public char getFlag()(Code) | | Get flag character for parameter.
flag character specifying the parameter |
handle | abstract public void handle(ArgumentProcessor proc)(Code) | | 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 |
|
|