- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- snaq.util.jclap.OptionException
-
- All Implemented Interfaces:
Serializable
public final class OptionException extends Exception
Exception for command-line option parsing problems.- Author:
- Giles Winstanley
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOptionException.TypeDefines the types ofOptionExceptionthat exist.
-
Field Summary
Fields Modifier and Type Field Description protected static ResourceBundleBUNDLEResources for internationalization.protected static LocaleLOCALELocalefor help/error display.
-
Constructor Summary
Constructors Constructor Description OptionException(OptionException.Type type, String optionName)Creates a newOptionExceptioninstance.OptionException(OptionException.Type type, String optionName, char flag)Creates a newOptionExceptioninstance.OptionException(OptionException.Type type, String optionName, String optionValue)Creates a newOptionExceptioninstance.OptionException(OptionException.Type type, Option option)Creates a newOptionExceptioninstance.OptionException(OptionException.Type type, Option option, String optionValue)Creates a newOptionExceptioninstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetLocalizedMessage()StringgetMessage()OptionException.TypegetType()-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
LOCALE
protected static final Locale LOCALE
Localefor help/error display.
-
BUNDLE
protected static final ResourceBundle BUNDLE
Resources for internationalization.
-
-
Constructor Detail
-
OptionException
public OptionException(OptionException.Type type, Option option, String optionValue)
Creates a newOptionExceptioninstance.- Parameters:
type- type ofOptionExceptionto create (i.e. reason)option-Optioninstance for which this exception is being createdoptionValue- value of the option for which this exception is being created
-
OptionException
public OptionException(OptionException.Type type, String optionName, String optionValue)
Creates a newOptionExceptioninstance.- Parameters:
type- type ofOptionExceptionto create (i.e. reason)optionName- name of the option for which this exception is being createdoptionValue- value of the option for which this exception is being created
-
OptionException
public OptionException(OptionException.Type type, String optionName, char flag)
Creates a newOptionExceptioninstance.- Parameters:
type- type ofOptionExceptionto create (i.e. reason)optionName- name of the option for which this exception is being createdflag- flag character for which this exception is being created
-
OptionException
public OptionException(OptionException.Type type, Option option)
Creates a newOptionExceptioninstance.- Parameters:
type- type ofOptionExceptionto create (i.e. reason)option-Optioninstance for which this exception is being created
-
OptionException
public OptionException(OptionException.Type type, String optionName)
Creates a newOptionExceptioninstance.- Parameters:
type- type ofOptionExceptionto create (i.e. reason)optionName- name of the option for which this exception is being created
-
-
Method Detail
-
getType
public OptionException.Type getType()
- Returns:
- exception type
-
getMessage
public String getMessage()
- Overrides:
getMessagein classThrowable
-
getLocalizedMessage
public String getLocalizedMessage()
- Overrides:
getLocalizedMessagein classThrowable
-
-