Package org.apache.commons.cli
Class AlreadySelectedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.apache.commons.cli.ParseException
-
- org.apache.commons.cli.AlreadySelectedException
-
- All Implemented Interfaces:
java.io.Serializable
public class AlreadySelectedException extends ParseException
Thrown when more than one option in an option group has been provided.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private OptionoptionThe option that triggered the exception.private OptionGroupoptionGroupThe option group selected.private static longserialVersionUIDThis exceptionserialVersionUID.
-
Constructor Summary
Constructors Modifier Constructor Description AlreadySelectedException(java.lang.String message)Constructs a newAlreadySelectedExceptionwith the specified detail message.privateAlreadySelectedException(java.lang.String message, OptionGroup optionGroup, Option option)AlreadySelectedException(OptionGroup optionGroup, Option option)Constructs a newAlreadySelectedExceptionfor the specified option group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OptiongetOption()Gets the option that was added to the group and triggered the exception.OptionGroupgetOptionGroup()Gets the option group where another option has been selected.-
Methods inherited from class org.apache.commons.cli.ParseException
wrap
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
This exceptionserialVersionUID.- See Also:
- Constant Field Values
-
optionGroup
private final OptionGroup optionGroup
The option group selected.
-
option
private final Option option
The option that triggered the exception.
-
-
Constructor Detail
-
AlreadySelectedException
public AlreadySelectedException(OptionGroup optionGroup, Option option)
Constructs a newAlreadySelectedExceptionfor the specified option group.- Parameters:
optionGroup- the option group already selected.option- the option that triggered the exception.- Since:
- 1.2
-
AlreadySelectedException
public AlreadySelectedException(java.lang.String message)
Constructs a newAlreadySelectedExceptionwith the specified detail message.- Parameters:
message- the detail message.
-
AlreadySelectedException
private AlreadySelectedException(java.lang.String message, OptionGroup optionGroup, Option option)
-
-
Method Detail
-
getOption
public Option getOption()
Gets the option that was added to the group and triggered the exception.- Returns:
- the related option.
- Since:
- 1.2
-
getOptionGroup
public OptionGroup getOptionGroup()
Gets the option group where another option has been selected.- Returns:
- the related option group.
- Since:
- 1.2
-
-