org.apache.commons.cli
Class AlreadySelectedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.apache.commons.cli.ParseException
              extended by org.apache.commons.cli.AlreadySelectedException
All Implemented Interfaces:
Serializable

public class AlreadySelectedException
extends ParseException

Thrown when more than one option in an option group has been provided.

Version:
$Revision: 680644 $, $Date: 2008-07-29 01:13:48 -0700 (Tue, 29 Jul 2008) $
Author:
John Keyes ( john at integralsource.com )
See Also:
Serialized Form

Constructor Summary
AlreadySelectedException(OptionGroup group, Option option)
          Construct a new AlreadySelectedException for the specified option group.
AlreadySelectedException(String message)
          Construct a new AlreadySelectedException with the specified detail message.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlreadySelectedException

public AlreadySelectedException(String message)
Construct a new AlreadySelectedException with the specified detail message.

Parameters:
message - the detail message

AlreadySelectedException

public AlreadySelectedException(OptionGroup group,
                                Option option)
Construct a new AlreadySelectedException for the specified option group.

Parameters:
group - the option group already selected
option - 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


Copyright © 2002-2009 The Apache Software Foundation. All Rights Reserved.