org.xlattice.util.cmdline
Class IntOpt
java.lang.Object
org.xlattice.util.cmdline.CmdLineOpt
org.xlattice.util.cmdline.IntOpt
public class IntOpt
- extends CmdLineOpt
Bind a command line argument to an int field in an object,
optionally specifiying minimum and maximum value.
- Author:
- Jim Dixon
Constructor Summary |
IntOpt(java.lang.String oName,
java.lang.String fName)
|
IntOpt(java.lang.String oName,
java.lang.String fName,
int min,
int max)
|
IntOpt(java.lang.String oName,
java.lang.String fName,
java.lang.String desc)
|
IntOpt(java.lang.String oName,
java.lang.String fName,
java.lang.String desc,
int min,
int max)
Create a command line argument-int field binding. |
Method Summary |
protected void |
bindField(java.lang.Class clazz)
Bind parameter to target class field. |
java.lang.String |
optionForHelp()
Overridden if something more elaborate than '-h' is needed. |
protected void |
setValue(Bindery bnd)
Set the value in the object field bound to this option. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IntOpt
public IntOpt(java.lang.String oName,
java.lang.String fName,
java.lang.String desc,
int min,
int max)
- Create a command line argument-int field binding.
- Parameters:
oName
- option namefName
- field namedesc
- description for use in help messagesmin
- minimum permissible valuemax
- maximum permissible value
IntOpt
public IntOpt(java.lang.String oName,
java.lang.String fName,
int min,
int max)
IntOpt
public IntOpt(java.lang.String oName,
java.lang.String fName,
java.lang.String desc)
IntOpt
public IntOpt(java.lang.String oName,
java.lang.String fName)
optionForHelp
public java.lang.String optionForHelp()
- Description copied from class:
CmdLineOpt
- Overridden if something more elaborate than '-h' is needed.
- Overrides:
optionForHelp
in class CmdLineOpt
- Returns:
- option as seen in help messages
bindField
protected void bindField(java.lang.Class clazz)
- Description copied from class:
CmdLineOpt
- Bind parameter to target class field. Must be invoked by subclasses.
- Overrides:
bindField
in class CmdLineOpt
- Parameters:
clazz
- target class for saving parameter values
setValue
protected void setValue(Bindery bnd)
- Description copied from class:
CmdLineOpt
- Set the value in the object field bound to this option.
Needs to be implemented for each primitive type accepted
on the command line.
- Specified by:
setValue
in class CmdLineOpt
- Parameters:
bnd
- command line option bindery invoking setValue