Class ExceptionHandler

java.lang.Object
  |
  +--ExceptionHandler

public class ExceptionHandler
extends java.lang.Object

The class that handles the exceptions from all classes in the SituationRecognizer. It also prints out debug information if the DEBUG variable is set to true.


Field Summary
static boolean DEBUG
          If this attribute is set to true debug information will be written to System.out.
 
Constructor Summary
ExceptionHandler()
           
 
Method Summary
static void debugMessage(java.lang.String message)
          Writes the given information to System.out if DEBUG is set to true.
static void handleException(java.lang.String message)
          Prints the given exception message to System.err.
static void handleException(java.lang.String message, java.lang.Exception e)
          Prints the given message to System.err followed by the message of the given exception.
static void handleException(java.lang.String message, jess.JessException e)
          Prints the given message to System.err followed by some information that is stored in the given JessException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG
If this attribute is set to true debug information will be written to System.out.

Constructor Detail

ExceptionHandler

public ExceptionHandler()
Method Detail

handleException

public static void handleException(java.lang.String message)
Prints the given exception message to System.err.

Parameters:
message - The message that describes the exception.

handleException

public static void handleException(java.lang.String message,
                                   java.lang.Exception e)
Prints the given message to System.err followed by the message of the given exception.

Parameters:
message - A message that gives some extra information about the exception.
e - The exception that was thrown.

handleException

public static void handleException(java.lang.String message,
                                   jess.JessException e)
Prints the given message to System.err followed by some information that is stored in the given JessException. This can explain where exactly the error is in the JESS engine.

Parameters:
message - A message that gives some extra information about the exception.
e - The JessException that was thrown.

debugMessage

public static void debugMessage(java.lang.String message)
Writes the given information to System.out if DEBUG is set to true.

Parameters:
message - A message that contains some debug information.