org.apache.commons.cli2
Class OptionException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.apache.commons.cli2.OptionException
All Implemented Interfaces:
java.io.Serializable

public class OptionException
extends java.lang.Exception

A problem found while dealing with command line options.

See Also:
Serialized Form

Field Summary
static java.util.Set HELP_SETTINGS
          The settings used when displaying the related Option.
private static ResourceHelper helper
          resource helper instance
private  java.lang.String message
          The message explaining the Exception
private  Option option
          The Option the exception relates to
 
Constructor Summary
OptionException(Option option)
          Creates a new OptionException.
OptionException(Option option, java.lang.String messageKey)
          Creates a new OptionException.
OptionException(Option option, java.lang.String messageKey, java.lang.String value)
          Creates a new OptionException.
 
Method Summary
 java.lang.String getMessage()
           
 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 java.util.Set HELP_SETTINGS
The settings used when displaying the related Option.

See Also:
DisplaySetting

helper

private static final ResourceHelper helper
resource helper instance


option

private final Option option
The Option the exception relates to


message

private final java.lang.String message
The message explaining the Exception

Constructor Detail

OptionException

public OptionException(Option option)
Creates a new OptionException.

Parameters:
option - The Option the exception relates to

OptionException

public OptionException(Option option,
                       java.lang.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,
                       java.lang.String messageKey,
                       java.lang.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 java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable