org.incava.jagol
Class Option

java.lang.Object
  extended by org.incava.jagol.Option
Direct Known Subclasses:
BooleanOption, ListOption, NonBooleanOption

public abstract class Option
extends java.lang.Object

Base class of all options.


Field Summary
protected  java.lang.String longName
           
protected  char shortName
           
 
Constructor Summary
Option(java.lang.String longName, java.lang.String description)
           
 
Method Summary
 java.lang.String getDescription()
          Returns the description.
 java.lang.String getLongName()
          Returns the long option name.
 char getShortName()
          Returns the short option name.
abstract  boolean set(java.lang.String arg, java.util.List args)
          Sets from a list of command-line arguments.
 void setLongName(java.lang.String longName)
           
 void setShortName(char shortName)
           
abstract  void setValue(java.lang.String value)
          Sets the value from the string, for this option type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

longName

protected java.lang.String longName

shortName

protected char shortName
Constructor Detail

Option

public Option(java.lang.String longName,
              java.lang.String description)
Method Detail

setShortName

public void setShortName(char shortName)

setLongName

public void setLongName(java.lang.String longName)

getLongName

public java.lang.String getLongName()
Returns the long option name.


getShortName

public char getShortName()
Returns the short option name.


getDescription

public java.lang.String getDescription()
Returns the description.


set

public abstract boolean set(java.lang.String arg,
                            java.util.List args)
                     throws OptionException
Sets from a list of command-line arguments. Returns whether this option could be set from the current head of the list.

Throws:
OptionException

setValue

public abstract void setValue(java.lang.String value)
                       throws InvalidTypeException
Sets the value from the string, for this option type.

Throws:
InvalidTypeException