org.jcommando
Class Option

java.lang.Object
  extended byorg.jcommando.Option

public class Option
extends java.lang.Object

This class encapsulates the state of an 'option' specified in a JCommando XML file.

Author:
Brett Wooldridge

Constructor Summary
Option()
          Default constructor.
 
Method Summary
 java.lang.String getDescription()
          Get the textual description of this option.
 java.lang.String getId()
          Get the unique identifier for this option.
 java.lang.String getLongMnemonic()
          Get the long form of this option.
 double getMax()
          Get the maximum valid value of this option.
 double getMin()
          Get the minumum valid value of this option.
 java.lang.String getOptionType()
          Get the Java type of this option.
 java.lang.String getShortMnemonic()
          Get the short form of this option.
 void setDescription(java.lang.String desc)
          Set the textual description of this option.
 void setId(java.lang.String optionId)
          Set the unique identifier for this option.
 void setLongMnemonic(java.lang.String lMnemonic)
          Set the long form of this option.
 void setMax(double d)
          Set the maximum valid value of this option.
 void setMin(double d)
          Set the minumum valid value of this option.
 void setOptionType(java.lang.String type)
          Set the Java type of this option.
 void setShortMnemonic(java.lang.String sMnemonic)
          Set the short form of this option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Option

public Option()
Default constructor.

Method Detail

getDescription

public java.lang.String getDescription()
Get the textual description of this option.

Returns:
Returns the description.

getLongMnemonic

public java.lang.String getLongMnemonic()
Get the long form of this option.

Returns:
Returns the longMnemonic.

getOptionType

public java.lang.String getOptionType()
Get the Java type of this option. The returned string is one of: long, double, String

Returns:
Returns the optionType.

getShortMnemonic

public java.lang.String getShortMnemonic()
Get the short form of this option.

Returns:
Returns the shortMnemonic.

setDescription

public void setDescription(java.lang.String desc)
Set the textual description of this option.

Parameters:
desc - The description to set.

setLongMnemonic

public void setLongMnemonic(java.lang.String lMnemonic)
Set the long form of this option.

Parameters:
lMnemonic - The longMnemonic to set.

setOptionType

public void setOptionType(java.lang.String type)
Set the Java type of this option. This string must be one of: long, double, String.

Parameters:
type - The optionType to set.

setShortMnemonic

public void setShortMnemonic(java.lang.String sMnemonic)
Set the short form of this option.

Parameters:
sMnemonic - The shortMnemonic to set.

getId

public java.lang.String getId()
Get the unique identifier for this option.

Returns:
Returns the id.

setId

public void setId(java.lang.String optionId)
Set the unique identifier for this option. This identifier must be a valid Java identifier.

Parameters:
optionId - The id to set.

getMax

public double getMax()
Get the maximum valid value of this option. If not set, or not applicable, this returns Long.MAX_VALUE if the 'type' is long, or Double.MAX_VALUE if the 'type' is double.

Returns:
Returns the max.

setMax

public void setMax(double d)
Set the maximum valid value of this option. Only applicable for options where the type is long or double.

Parameters:
d - The max to set.

getMin

public double getMin()
Get the minumum valid value of this option. If not set, or not applicable, this returns Long.MAX_VALUE if the 'type' is long, or Double.MAX_VALUE if the 'type' is double.

Returns:
Returns the min.

setMin

public void setMin(double d)
Set the minumum valid value of this option. Only applicable for options where the type is long or double.

Parameters:
d - The min to set.