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.- Version:
- $Id: AlreadySelectedException.java 1443102 2013-02-06 18:12:16Z tn $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private OptionGroup
group
The option group selected.private Option
option
The option that triggered the exception.private static long
serialVersionUID
This exceptionserialVersionUID
.
-
Constructor Summary
Constructors Constructor Description AlreadySelectedException(java.lang.String message)
Construct a newAlreadySelectedException
with the specified detail message.AlreadySelectedException(OptionGroup group, Option option)
Construct a newAlreadySelectedException
for the specified option group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Option
getOption()
Returns the option that was added to the group and triggered the exception.OptionGroup
getOptionGroup()
Returns the option group where another option has been selected.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
This exceptionserialVersionUID
.- See Also:
- Constant Field Values
-
group
private OptionGroup group
The option group selected.
-
option
private Option option
The option that triggered the exception.
-
-
Constructor Detail
-
AlreadySelectedException
public AlreadySelectedException(java.lang.String message)
Construct a newAlreadySelectedException
with the specified detail message.- Parameters:
message
- the detail message
-
AlreadySelectedException
public AlreadySelectedException(OptionGroup group, Option option)
Construct a newAlreadySelectedException
for the specified option group.- Parameters:
group
- the option group already selectedoption
- the option that triggered the exception- Since:
- 1.2
-
-
Method Detail
-
getOptionGroup
public OptionGroup getOptionGroup()
Returns the option group where another option has been selected.- Returns:
- the related option group
- Since:
- 1.2
-
getOption
public Option getOption()
Returns the option that was added to the group and triggered the exception.- Returns:
- the related option
- Since:
- 1.2
-
-