Package org.svetovid

Class SvetovidException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SvetovidFormatException, SvetovidIOException, SvetovidJsonException

public class SvetovidException extends RuntimeException
SvetovidException is the superclass of those exceptions that can be thrown during the operation of this library. SvetovidException and its subclasses are unchecked exceptions.
Author:
Ivan Pribela
See Also:
  • Constructor Details

    • SvetovidException

      public SvetovidException(String messageKey, Object... messageArguments)
      Constructs a SvetovidException with the specified message.
      Parameters:
      messageKey - The resource bundle key of the detail message, which is saved for later retrieval by the getMessage() method
      messageArguments - Optional arguments for formatting of the detail message
    • SvetovidException

      public SvetovidException(String messageKey, Throwable cause, Object... messageArguments)
      Constructs a SvetovidException with the specified detail message and cause.

      Note that the detail message associated with cause is not automatically incorporated into this exception's detail message.

      Parameters:
      messageKey - The resource bundle key of the detail message, which is saved for later retrieval by the getMessage() method
      cause - The cause, which is saved for later retrieval by the Throwable.getCause() method. A null value is permitted, and indicates that the cause is nonexistent or unknown.
      messageArguments - Optional arguments for formatting of the detail message
  • Method Details

    • getMessage

      public String getMessage()
      Returns the detail message string of this exception.
      Overrides:
      getMessage in class Throwable
      Returns:
      the formatted detail message of this exception instance.
    • getMessage

      public String getMessage(Locale locale)
      Creates a localized description of this exception.
      Parameters:
      locale - the Locale in which to return the message
      Returns:
      The localized description of this exception.
    • printStackTrace

      public void printStackTrace()
      Prints this exception and its stack trace to the standard error stream.
      Overrides:
      printStackTrace in class Throwable
    • printStackTrace

      public void printStackTrace(PrintStream stream)
      Prints this exception and its stack trace to the specified print stream.
      Overrides:
      printStackTrace in class Throwable
      Parameters:
      stream - PrintStream to use for output
    • printStackTrace

      public void printStackTrace(PrintWriter writer)
      Prints this exception and its stack trace to the specified print writer.
      Overrides:
      printStackTrace in class Throwable
      Parameters:
      writer - PrintWriter to use for output
    • printStackTrace

      public void printStackTrace(Locale locale)
      Prints this exception and its stack trace to the standard error stream in the specified locale.
      Parameters:
      locale - the local to use for printing
    • printStackTrace

      public void printStackTrace(PrintStream stream, Locale locale)
      Prints this exception and its stack trace to the specified print stream in the specified locale.
      Parameters:
      stream - PrintStream to use for output
      locale - the local to use for printing
    • printStackTrace

      public void printStackTrace(PrintWriter writer, Locale locale)
      Prints this exception and its stack trace to the specified print writer in the specified locale.
      Parameters:
      writer - PrintWriter to use for output
      locale - the local to use for printing
    • printStackTrace

      public static void printStackTrace(Thread thread, Throwable throwable)
      Prints the supplied throwable and its stack trace to the standard error stream. If the thread is supplied also, its name is printed before the throwable.
      Parameters:
      thread - the thread on which the throwable was thrown; if it is null no thread info is printed
      throwable - the throwable whose stack trace is to be printed
    • printStackTrace

      public static void printStackTrace(Thread thread, Throwable throwable, PrintStream stream)
      Prints the supplied throwable and its stack trace to the specified print stream. If the thread is supplied also, its name is printed before the throwable.
      Parameters:
      thread - the thread on which the throwable was thrown; if it is null no thread info is printed
      throwable - the throwable whose stack trace is to be printed
      stream - PrintStream to use for output
    • printStackTrace

      public static void printStackTrace(Thread thread, Throwable throwable, PrintWriter writer)
      Prints the supplied throwable and its stack trace to the specified print writer. If the thread is supplied also, its name is printed before the throwable.
      Parameters:
      thread - the thread on which the throwable was thrown; if it is null no thread info is printed
      throwable - the throwable whose stack trace is to be printed
      writer - PrintWriter to use for output
    • printStackTrace

      public static void printStackTrace(Thread thread, Throwable throwable, Locale locale)
      Prints the supplied throwable and its stack trace to the standard error stream in the specified locale. If the thread is supplied also, its name is printed before the throwable.
      Parameters:
      thread - the thread on which the throwable was thrown; if it is null no thread info is printed
      throwable - the throwable whose stack trace is to be printed
      locale - the local to use for printing
    • printStackTrace

      public static void printStackTrace(Thread thread, Throwable throwable, PrintStream stream, Locale locale)
      Prints the supplied throwable and its stack trace to the specified print stream in the specified locale. If the thread is supplied also, its name is printed before the throwable.
      Parameters:
      thread - the thread on which the throwable was thrown; if it is null no thread info is printed
      throwable - the throwable whose stack trace is to be printed
      stream - PrintStream to use for output
      locale - the local to use for printing
    • printStackTrace

      public static void printStackTrace(Thread thread, Throwable throwable, PrintWriter writer, Locale locale)
      Prints the supplied throwable and its stack trace to the specified print writer in the specified locale. If the thread is supplied also, its name is printed before the throwable.
      Parameters:
      thread - the thread on which the throwable was thrown; if it is null no thread info is printed
      throwable - the throwable whose stack trace is to be printed
      writer - PrintWriter to use for output
      locale - the local to use for printing
    • getStackTraceString

      public static String getStackTraceString(Throwable throwable, Locale locale)
      Returns the message string in the specified locale containing the supplied throwable and its stack trace.
      Parameters:
      throwable - the throwable whose stack trace is to be printed
      locale - the local to use for printing
      Returns:
      the string containing the supplied throwable and its stack trace.
    • getStackTraceString

      public static String getStackTraceString(Thread thread, Throwable throwable, Locale locale)
      Returns the message string in the specified locale containing the supplied throwable and its stack trace. If the thread is supplied also, its name is printed before the throwable.
      Parameters:
      thread - the thread on which the throwable was thrown; if it is null no thread info is printed
      throwable - the throwable whose stack trace is to be printed
      locale - the local to use for printing
      Returns:
      the string containing the supplied throwable and its stack trace.
    • appendThreadInfo

      protected static void appendThreadInfo(StringBuilder builder, Thread thread, String prefix, ResourceBundle bundle, Locale locale)
    • appendStackTrace

      protected static void appendStackTrace(StringBuilder builder, Throwable throwable, StackTraceElement[] originalStackTrace, String role, String prefix, Set<Throwable> dejaVu, ResourceBundle bundle, Locale locale)
    • appendThrowable

      protected static void appendThrowable(StringBuilder builder, Throwable throwable, String role, String prefix, ResourceBundle bundle, Locale locale)
    • appendStackTraceElement

      protected static void appendStackTraceElement(StringBuilder builder, StackTraceElement element, String prefix, ResourceBundle bundle, Locale locale)