snaq.util.jclap
Class OptionException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by snaq.util.jclap.OptionException
All Implemented Interfaces:
java.io.Serializable

public final class OptionException
extends java.lang.Exception

Exception for command-line option parsing problems.

Author:
Giles Winstanley
See Also:
Serialized Form

Nested Class Summary
static class OptionException.Type
          Defines the types of OptionException that exist.
 
Constructor Summary
OptionException(OptionException.Type type, Option option)
          Creates a new OptionException instance.
OptionException(OptionException.Type type, Option option, java.lang.String optionValue)
          Creates a new OptionException instance.
OptionException(OptionException.Type type, java.lang.String optionName)
          Creates a new OptionException instance.
OptionException(OptionException.Type type, java.lang.String optionName, char flag)
          Creates a new OptionException instance.
OptionException(OptionException.Type type, java.lang.String optionName, java.lang.String optionValue)
          Creates a new OptionException instance.
 
Method Summary
 java.lang.String getLocalizedMessage()
           
 java.lang.String getMessage()
           
 OptionException.Type getType()
          Returns the type of this OptionException.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OptionException

public OptionException(OptionException.Type type,
                       Option option,
                       java.lang.String optionValue)
Creates a new OptionException instance.

Parameters:
type - type of OptionException to create (i.e. reason)
option - Option instance for which this exception is being created
optionValue - value of the option for which this exception is being created

OptionException

public OptionException(OptionException.Type type,
                       java.lang.String optionName,
                       java.lang.String optionValue)
Creates a new OptionException instance.

Parameters:
type - type of OptionException to create (i.e. reason)
optionName - name of the option for which this exception is being created
optionValue - value of the option for which this exception is being created

OptionException

public OptionException(OptionException.Type type,
                       java.lang.String optionName,
                       char flag)
Creates a new OptionException instance.

Parameters:
type - type of OptionException to create (i.e. reason)
optionName - name of the option for which this exception is being created
flag - flag character for which this exception is being created

OptionException

public OptionException(OptionException.Type type,
                       Option option)
Creates a new OptionException instance.

Parameters:
type - type of OptionException to create (i.e. reason)
option - Option instance for which this exception is being created

OptionException

public OptionException(OptionException.Type type,
                       java.lang.String optionName)
Creates a new OptionException instance.

Parameters:
type - type of OptionException to create (i.e. reason)
optionName - name of the option for which this exception is being created
Method Detail

getType

public OptionException.Type getType()
Returns the type of this OptionException.


getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable

getLocalizedMessage

public java.lang.String getLocalizedMessage()
Overrides:
getLocalizedMessage in class java.lang.Throwable