org.jwalk
Class SettingsException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.jwalk.JWalkException
              extended by org.jwalk.SettingsException
All Implemented Interfaces:
java.io.Serializable

public class SettingsException
extends JWalkException

SettingsException signals when incorrect test settings have been supplied. This exception may be raised by third-party tools which convert user inputs into the symbolic and numeric types used for all test settings in JWalkers. It caters for a number of fault-kinds, including failure to convert a String to a suitable enumerated value, or failure to convert a String to a suitable integer value. Tools in the JWalk tool-suite may not raise this exception, if they constrain user inputs in such a way that they are always convertible as expected.

Version:
1.1
Author:
Anthony Simons
See Also:
Serialized Form

Constructor Summary
SettingsException(java.lang.Object badValue)
          Creates a SettingsException for a bad enumerated input.
SettingsException(java.lang.Object badValue, boolean integral)
          Creates a SettingsException for a bad integer input.
 
Method Summary
 boolean enumConversionFailed()
          Reports if the failure was due to a bad Enum conversion.
 java.lang.Object getValue()
          Returns the value which caused the settings conversion failure.
 boolean intConversionFailed()
          Reports if the failure was due to bad int conversion.
 
Methods inherited from class org.jwalk.JWalkException
getError
 
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

SettingsException

public SettingsException(java.lang.Object badValue)
Creates a SettingsException for a bad enumerated input.

Parameters:
badValue - the String form of the bad value.

SettingsException

public SettingsException(java.lang.Object badValue,
                         boolean integral)
Creates a SettingsException for a bad integer input.

Parameters:
badValue - the String form of the bad value.
Method Detail

getValue

public java.lang.Object getValue()
Returns the value which caused the settings conversion failure.


enumConversionFailed

public boolean enumConversionFailed()
Reports if the failure was due to a bad Enum conversion. The bad value could not be converted into the expected Enum type.

Returns:
true, if this was a bad Enum conversion.

intConversionFailed

public boolean intConversionFailed()
Reports if the failure was due to bad int conversion. The bad value could not be converted into the expected int type.

Returns:
true, if this was a bad int conversion.