org.jcon.util
Class CommandLineOption

java.lang.Object
  extended by org.jcon.util.CommandLineOption
All Implemented Interfaces:
java.io.Serializable

public class CommandLineOption
extends java.lang.Object
implements java.io.Serializable

An option for a CommandLineSyntax.

CommandLineOptions are those parts of a command line with dashes ("-") prefixing them. They are usually optional (hence the name) and specify various modifiers and such for the command line program.

For our purposes, all CommandLineOptions can be specified two ways: as a brief, single character prefixed by a single dash ("-f"), or as a long, more meaningful word prefixed by two dashes ("--filename").

Some options are switches, and need no arguments. If present, they are on; if not they are off. Others have one or more arguments. These are listed after the option identifier.

Author:
Paul Reavis
See Also:
Serialized Form

Constructor Summary
CommandLineOption()
           
CommandLineOption(java.lang.String shortName, java.lang.String longName, java.lang.String description)
          Constructs a switch option (no arguments)
 
Method Summary
 java.lang.String getDefaultValue()
           
 java.lang.String getDescription()
           
 java.lang.String getLongName()
           
 java.lang.String getShortName()
           
 boolean isSwitch()
           
 void setDefaultValue(java.lang.String newDefaultValue)
           
 void setDescription(java.lang.String newDescription)
           
 void setLongName(java.lang.String newLongName)
           
 void setShortName(java.lang.String newShortName)
           
 void setSwitch(boolean newSwitch)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommandLineOption

public CommandLineOption()

CommandLineOption

public CommandLineOption(java.lang.String shortName,
                         java.lang.String longName,
                         java.lang.String description)
Constructs a switch option (no arguments)

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getShortName

public java.lang.String getShortName()

setShortName

public void setShortName(java.lang.String newShortName)

getLongName

public java.lang.String getLongName()

setLongName

public void setLongName(java.lang.String newLongName)

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String newDescription)

isSwitch

public boolean isSwitch()

setSwitch

public void setSwitch(boolean newSwitch)

getDefaultValue

public java.lang.String getDefaultValue()

setDefaultValue

public void setDefaultValue(java.lang.String newDefaultValue)