net.dpml.cli

Class OptionException


public class OptionException
extends Exception

A problem found while dealing with command line options.
Version:
@PROJECT-VERSION@
Author:
@PUBLISHER-NAME@

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

Field Details

HELP_SETTINGS

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

Constructor Details

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 Details

getMessage

public String getMessage()
Return the exception message.
Returns:
the exception message

getOption

public Option getOption()
Gets the Option the exception relates to
Returns:
The related Option