com.fedmest.cw.keyboard
Class KeyboardInputException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.fedmest.cw.keyboard.KeyboardInputException
All Implemented Interfaces:
java.io.Serializable

public class KeyboardInputException
extends java.lang.Exception

A keyboard validator (a class implementing KeyboardInputValidator) will throw this exception when the input string does not conform to the requirements of the expected data type. The exception should contain an error message that the framework will display to the user before asking them to try again. The user will have to continue typing until validation succeeds. If this object is given a source exception, it will be used by the framework to print out its stack trace.

Version:
1.0
Author:
Federico Mestrone
See Also:
Serialized Form

Constructor Summary
KeyboardInputException()
          Creates a new instance of this exception with no message for the user and no cause.
KeyboardInputException(java.lang.String message)
          Creates a new instance of this exception with a message for the user but no cause.
KeyboardInputException(java.lang.String message, java.lang.Throwable cause)
          Creates a new instance of this exception with a message for the user and a cause.
KeyboardInputException(java.lang.Throwable cause)
          Creates a new instance of this exception with a cause but no message for the user.
 
Method Summary
 
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

KeyboardInputException

public KeyboardInputException()
Creates a new instance of this exception with no message for the user and no cause. No explanation or stack trace will be given to the user.


KeyboardInputException

public KeyboardInputException(java.lang.String message,
                              java.lang.Throwable cause)
Creates a new instance of this exception with a message for the user and a cause. The message will be displayed and the user will be prompted to try again. The stack trace of the cause will also be printed.

Parameters:
message - the error message that the user will see
cause - the cause that will provide the stack trace for display

KeyboardInputException

public KeyboardInputException(java.lang.String message)
Creates a new instance of this exception with a message for the user but no cause. The message will be displayed and the user will be prompted to try again. No stack trace will be printed. This is meant as the preferred way of raising exceptions within this framework.

Parameters:
message - the error message that the user will see

KeyboardInputException

public KeyboardInputException(java.lang.Throwable cause)
Creates a new instance of this exception with a cause but no message for the user. The stack trace of the cause will be printed. No message will be displayed to the user.

Parameters:
cause - the cause that will provide the stack trace for display


Copyright © 2008 Federico Mestrone. All Rights Reserved.