net.dpml.cli
Class OptionException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bynet.dpml.cli.OptionException
All Implemented Interfaces:
Serializable

public class OptionException
extends Exception

A problem found while dealing with command line options.

Version:
1.0.0
Author:
Digital Product Meta Library
See Also:
Serialized Form

Field Summary
static Set HELP_SETTINGS
          The settings used when displaying the related Option.
 
Constructor Summary
OptionException(Option option)
          Creates a new OptionException.
OptionException(Option option, String messageKey)
          Creates a new OptionException.
OptionException(Option option, String messageKey, String value)
          Creates a new OptionException.
 
Method Summary
 String getMessage()
          Return the exception message.
 Option getOption()
          Gets the Option the exception relates to
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HELP_SETTINGS

public static final Set HELP_SETTINGS
The settings used when displaying the related Option.

See Also:
DisplaySetting
Constructor Detail

OptionException

public OptionException(Option option)
Creates a new OptionException.

Parameters:
option - the Option the exception relates to

OptionException

public OptionException(Option option,
                       String messageKey)
Creates a new OptionException.

Parameters:
option - the Option the exception relates to
messageKey - the id of the message to display

OptionException

public OptionException(Option option,
                       String messageKey,
                       String value)
Creates a new OptionException.

Parameters:
option - the Option the exception relates to
messageKey - the id of the message to display
value - a value to display with the message
Method Detail

getOption

public Option getOption()
Gets the Option the exception relates to

Returns:
The related Option

getMessage

public String getMessage()
Return the exception message.

Returns:
the exception message