Package exceptions

Class Exception

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    EvaluationException, SemanticException

    public abstract class Exception
    extends java.lang.Throwable
    The Exception class is an abstract class used to represent exceptions that occur during compilation.

    Children classes of Exception call the parent constructor when initialised, and the majority of object generation is performed here, which stores information about the exception that occurred.

    Since:
    1.0
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Exception​(ExceptionType exceptionType, java.lang.String message)
      Constructs an Exception object for storing information about an exception that occurred during compilation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getMessage()
      Return the message for this Exception object.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, 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

      • Exception

        public Exception​(ExceptionType exceptionType,
                         java.lang.String message)
        Constructs an Exception object for storing information about an exception that occurred during compilation.

        To generate an Exception, the type of exception and a message detailing how it transpired must be defined.

        Parameters:
        exceptionType - The type of exception, which is based on where in the compilation process it occurred
        message - The message detailing what caused the exception to occur
    • Method Detail

      • getMessage

        public java.lang.String getMessage()
        Return the message for this Exception object.

        This message contains information about the location the Exception occurred in the code, the ExceptionType, and the class in which it developed.

        Overrides:
        getMessage in class java.lang.Throwable
        Returns:
        A String containing information about the exception