adaptj.util.OptionParser
Class BasicOption

java.lang.Object
  |
  +--adaptj.util.OptionParser.BasicOption
All Implemented Interfaces:
Option

public class BasicOption
extends java.lang.Object
implements Option


Constructor Summary
BasicOption(java.lang.String description)
           
 
Method Summary
 void addArgument(Argument argument, java.lang.String description)
           
 void addLongSwitch(java.lang.String s)
           
 void addShortSwitch(java.lang.String s)
           
 void addSwitch(java.lang.String s)
           
 java.lang.String[] getArgumentDescriptions()
          Returns an array of argument descriptions corresponding to the Argument objects returned by getArguments
 Argument[] getArguments()
          Returns the array of Argument objects for this option.
 java.lang.String getDescription()
          Returns the textual description of this option.
 java.lang.String[] getSwitches()
          Returns the valid switches for this option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicOption

public BasicOption(java.lang.String description)
Method Detail

addShortSwitch

public void addShortSwitch(java.lang.String s)

addLongSwitch

public void addLongSwitch(java.lang.String s)

addSwitch

public void addSwitch(java.lang.String s)

getDescription

public java.lang.String getDescription()
Description copied from interface: Option
Returns the textual description of this option. This value is used to print help about the commands.

Specified by:
getDescription in interface Option
Returns:
the textual description of this option.

getSwitches

public java.lang.String[] getSwitches()
Description copied from interface: Option
Returns the valid switches for this option. Typical exaples include "-s" and "--long-option", or null if the option is to be ignored, in which case this option will not appear in the usage and help information.

Specified by:
getSwitches in interface Option
Returns:
a array of switches that can be used to specify this option, or null if none exists.

getArguments

public Argument[] getArguments()
Description copied from interface: Option
Returns the array of Argument objects for this option. Argument objects are used to specifify the arguments that this option accepts.

Specified by:
getArguments in interface Option
Returns:
an array of Argument objects, or null if none exists.

getArgumentDescriptions

public java.lang.String[] getArgumentDescriptions()
Description copied from interface: Option
Returns an array of argument descriptions corresponding to the Argument objects returned by getArguments

Specified by:
getArgumentDescriptions in interface Option
Returns:
an array of argument descriptions, or null if none exists.

addArgument

public void addArgument(Argument argument,
                        java.lang.String description)