Package org.svetovid

Class SvetovidException

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    SvetovidFormatException, SvetovidIOException, SvetovidJsonException

    public class SvetovidException
    extends java.lang.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:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SvetovidException​(java.lang.String messageKey, java.lang.Object... messageArguments)
      Constructs a SvetovidException with the specified message.
      SvetovidException​(java.lang.String messageKey, java.lang.Throwable cause, java.lang.Object... messageArguments)
      Constructs a SvetovidException with the specified detail message and cause.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static void appendStackTrace​(java.lang.StringBuilder builder, java.lang.Throwable throwable, java.lang.StackTraceElement[] originalStackTrace, java.lang.String role, java.lang.String prefix, java.util.Set<java.lang.Throwable> dejaVu, java.util.ResourceBundle bundle, java.util.Locale locale)  
      protected static void appendStackTraceElement​(java.lang.StringBuilder builder, java.lang.StackTraceElement element, java.lang.String prefix, java.util.ResourceBundle bundle, java.util.Locale locale)  
      protected static void appendThreadInfo​(java.lang.StringBuilder builder, java.lang.Thread thread, java.lang.String prefix, java.util.ResourceBundle bundle, java.util.Locale locale)  
      protected static void appendThrowable​(java.lang.StringBuilder builder, java.lang.Throwable throwable, java.lang.String role, java.lang.String prefix, java.util.ResourceBundle bundle, java.util.Locale locale)  
      java.lang.String getMessage()
      Returns the detail message string of this exception.
      java.lang.String getMessage​(java.util.Locale locale)
      Creates a localized description of this exception.
      static java.lang.String getStackTraceString​(java.lang.Thread thread, java.lang.Throwable throwable, java.util.Locale locale)
      Returns the message string in the specified locale containing the supplied throwable and its stack trace.
      static java.lang.String getStackTraceString​(java.lang.Throwable throwable, java.util.Locale locale)
      Returns the message string in the specified locale containing the supplied throwable and its stack trace.
      void printStackTrace()
      Prints this exception and its stack trace to the standard error stream.
      void printStackTrace​(java.io.PrintStream stream)
      Prints this exception and its stack trace to the specified print stream.
      void printStackTrace​(java.io.PrintStream stream, java.util.Locale locale)
      Prints this exception and its stack trace to the specified print stream in the specified locale.
      void printStackTrace​(java.io.PrintWriter writer)
      Prints this exception and its stack trace to the specified print writer.
      void printStackTrace​(java.io.PrintWriter writer, java.util.Locale locale)
      Prints this exception and its stack trace to the specified print writer in the specified locale.
      static void printStackTrace​(java.lang.Thread thread, java.lang.Throwable throwable)
      Prints the supplied throwable and its stack trace to the standard error stream.
      static void printStackTrace​(java.lang.Thread thread, java.lang.Throwable throwable, java.io.PrintStream stream)
      Prints the supplied throwable and its stack trace to the specified print stream.
      static void printStackTrace​(java.lang.Thread thread, java.lang.Throwable throwable, java.io.PrintStream stream, java.util.Locale locale)
      Prints the supplied throwable and its stack trace to the specified print stream in the specified locale.
      static void printStackTrace​(java.lang.Thread thread, java.lang.Throwable throwable, java.io.PrintWriter writer)
      Prints the supplied throwable and its stack trace to the specified print writer.
      static void printStackTrace​(java.lang.Thread thread, java.lang.Throwable throwable, java.io.PrintWriter writer, java.util.Locale locale)
      Prints the supplied throwable and its stack trace to the specified print writer in the specified locale.
      static void printStackTrace​(java.lang.Thread thread, java.lang.Throwable throwable, java.util.Locale locale)
      Prints the supplied throwable and its stack trace to the standard error stream in the specified locale.
      void printStackTrace​(java.util.Locale locale)
      Prints this exception and its stack trace to the standard error stream in the specified locale.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SvetovidException

        public SvetovidException​(java.lang.String messageKey,
                                 java.lang.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​(java.lang.String messageKey,
                                 java.lang.Throwable cause,
                                 java.lang.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 Detail

      • getMessage

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

        public java.lang.String getMessage​(java.util.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 java.lang.Throwable
      • printStackTrace

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

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

        public void printStackTrace​(java.util.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​(java.io.PrintStream stream,
                                    java.util.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​(java.io.PrintWriter writer,
                                    java.util.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​(java.lang.Thread thread,
                                           java.lang.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​(java.lang.Thread thread,
                                           java.lang.Throwable throwable,
                                           java.io.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​(java.lang.Thread thread,
                                           java.lang.Throwable throwable,
                                           java.io.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​(java.lang.Thread thread,
                                           java.lang.Throwable throwable,
                                           java.util.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​(java.lang.Thread thread,
                                           java.lang.Throwable throwable,
                                           java.io.PrintStream stream,
                                           java.util.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​(java.lang.Thread thread,
                                           java.lang.Throwable throwable,
                                           java.io.PrintWriter writer,
                                           java.util.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 java.lang.String getStackTraceString​(java.lang.Throwable throwable,
                                                           java.util.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 java.lang.String getStackTraceString​(java.lang.Thread thread,
                                                           java.lang.Throwable throwable,
                                                           java.util.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​(java.lang.StringBuilder builder,
                                               java.lang.Thread thread,
                                               java.lang.String prefix,
                                               java.util.ResourceBundle bundle,
                                               java.util.Locale locale)
      • appendStackTrace

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

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

        protected static void appendStackTraceElement​(java.lang.StringBuilder builder,
                                                      java.lang.StackTraceElement element,
                                                      java.lang.String prefix,
                                                      java.util.ResourceBundle bundle,
                                                      java.util.Locale locale)