Class AbstractRuntimeException

All Implemented Interfaces:
Serializable, ErrorCodeAccessor, Trap
Direct Known Subclasses:
BugException, DisposedException, IntegrityException, IORuntimeException, LockedException.LockedRuntimeException, VerifyRuntimeException, VetoException.VetoRuntimeException

public abstract class AbstractRuntimeException extends RuntimeException implements Trap
Base exception for runtime (unchecked) / predictable (testable states) exceptions, providing functionality for exception specific multi-language messages. Regarding unchecked exception, "The Java Programming Language", by Gosling, Arnold, and Holmes says "... Unchecked runtime exceptions represent conditions that, generally speaking, reflect errors in your program's logic and cannot be reasonably recovered from at run time ...". Though you as a programmer can take care by according (business) logic to prevent such exception. Such exceptions may be accessing disposed components or any other aCause where you can test a state beforehand.
See Also:
  • Constructor Details

    • AbstractRuntimeException

      public AbstractRuntimeException(String aMessage, Throwable aCause)
      Instantiates a new abstract runtime exception.
      Parameters:
      aMessage - The aMessage describing this exception.
      aCause - The Throwable (Exception) causing this exception.
    • AbstractRuntimeException

      public AbstractRuntimeException(String aMessage)
      Instantiates a new abstract runtime exception.
      Parameters:
      aMessage - The aMessage describing this exception.
    • AbstractRuntimeException

      public AbstractRuntimeException(Throwable aCause)
      Instantiates a new abstract runtime exception.
      Parameters:
      aCause - The Throwable (Exception) causing this exception.
    • AbstractRuntimeException

      public AbstractRuntimeException(String aMessage, Throwable aCause, String aErrorCode)
      Parameters:
      aMessage - - the detail aMessage (which is saved for later retrieval by the Throwable.getMessage() method).
      aCause - - the aCause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the aCause is nonexistent or unknown.)
      aErrorCode - The exception code to be assigned to the exception. An exception code can be provided when creating an exception and it can be used by the business logic to retrieve a language depended exception aMessage (multi-language support) from a language pack instead of just providing the single language aMessage as being stored by the default exceptions.
    • AbstractRuntimeException

      public AbstractRuntimeException(String aMessage, String aErrorCode)
      Parameters:
      aMessage - - the detail aMessage (which is saved for later retrieval by the Throwable.getMessage() method).
      aErrorCode - The exception code to be assigned to the exception. An exception code can be provided when creating an exception and it can be used by the business logic to retrieve a language depended exception aMessage (multi-language support) from a language pack instead of just providing the single language aMessage as being stored by the default exceptions.
    • AbstractRuntimeException

      public AbstractRuntimeException(Throwable aCause, String aErrorCode)
      Parameters:
      aCause - - the aCause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the aCause is nonexistent or unknown.)
      aErrorCode - The exception code to be assigned to the exception. An exception code can be provided when creating an exception and it can be used by the business logic to retrieve a language depended exception aMessage (multi-language support) from a language pack instead of just providing the single language aMessage as being stored by the default exceptions.
  • Method Details

    • getErrorCode

      public String getErrorCode()
      Provides the according exception code. An exception code can be provided when creating an exception and it can be used by the business logic to retrieve a language depended exception aMessage (multi-language support) from a language pack instead of just providing the single language aMessage as being stored by the default exceptions.
      Specified by:
      getErrorCode in interface ErrorCodeAccessor
      Returns:
      The exception code in question.