Package org.svetovid
Class SvetovidException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.svetovid.SvetovidException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SvetovidFormatException
,SvetovidIOException
,SvetovidJsonException
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 Summary
ConstructorDescriptionSvetovidException
(String messageKey, Object... messageArguments) Constructs aSvetovidException
with the specified message.SvetovidException
(String messageKey, Throwable cause, Object... messageArguments) Constructs aSvetovidException
with the specified detail message and cause. -
Method Summary
Modifier and TypeMethodDescriptionprotected static void
appendStackTrace
(StringBuilder builder, Throwable throwable, StackTraceElement[] originalStackTrace, String role, String prefix, Set<Throwable> dejaVu, ResourceBundle bundle, Locale locale) protected static void
appendStackTraceElement
(StringBuilder builder, StackTraceElement element, String prefix, ResourceBundle bundle, Locale locale) protected static void
appendThreadInfo
(StringBuilder builder, Thread thread, String prefix, ResourceBundle bundle, Locale locale) protected static void
appendThrowable
(StringBuilder builder, Throwable throwable, String role, String prefix, ResourceBundle bundle, Locale locale) Returns the detail message string of this exception.getMessage
(Locale locale) Creates a localized description of this exception.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.static String
getStackTraceString
(Throwable throwable, Locale locale) Returns the message string in the specified locale containing the supplied throwable and its stack trace.void
Prints this exception and its stack trace to the standard error stream.void
printStackTrace
(PrintStream stream) Prints this exception and its stack trace to the specified print stream.void
printStackTrace
(PrintStream stream, Locale locale) Prints this exception and its stack trace to the specified print stream in the specified locale.void
printStackTrace
(PrintWriter writer) Prints this exception and its stack trace to the specified print writer.void
printStackTrace
(PrintWriter writer, Locale locale) Prints this exception and its stack trace to the specified print writer in the specified locale.static void
printStackTrace
(Thread thread, Throwable throwable) Prints the supplied throwable and its stack trace to the standard error stream.static void
printStackTrace
(Thread thread, Throwable throwable, PrintStream stream) Prints the supplied throwable and its stack trace to the specified print stream.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.static void
printStackTrace
(Thread thread, Throwable throwable, PrintWriter writer) Prints the supplied throwable and its stack trace to the specified print writer.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.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.void
printStackTrace
(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
-
Constructor Details
-
SvetovidException
Constructs aSvetovidException
with the specified message.- Parameters:
messageKey
- The resource bundle key of the detail message, which is saved for later retrieval by thegetMessage()
methodmessageArguments
- Optional arguments for formatting of the detail message
-
SvetovidException
Constructs aSvetovidException
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 thegetMessage()
methodcause
- The cause, which is saved for later retrieval by theThrowable.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
Returns the detail message string of this exception.- Overrides:
getMessage
in classThrowable
- Returns:
- the formatted detail message of this exception instance.
-
getMessage
Creates a localized description of this exception.- Parameters:
locale
- theLocale
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 classThrowable
-
printStackTrace
Prints this exception and its stack trace to the specified print stream.- Overrides:
printStackTrace
in classThrowable
- Parameters:
stream
-PrintStream
to use for output
-
printStackTrace
Prints this exception and its stack trace to the specified print writer.- Overrides:
printStackTrace
in classThrowable
- Parameters:
writer
-PrintWriter
to use for output
-
printStackTrace
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
Prints this exception and its stack trace to the specified print stream in the specified locale.- Parameters:
stream
-PrintStream
to use for outputlocale
- the local to use for printing
-
printStackTrace
Prints this exception and its stack trace to the specified print writer in the specified locale.- Parameters:
writer
-PrintWriter
to use for outputlocale
- the local to use for printing
-
printStackTrace
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 isnull
no thread info is printedthrowable
- the throwable whose stack trace is to be printed
-
printStackTrace
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 isnull
no thread info is printedthrowable
- the throwable whose stack trace is to be printedstream
-PrintStream
to use for output
-
printStackTrace
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 isnull
no thread info is printedthrowable
- the throwable whose stack trace is to be printedwriter
-PrintWriter
to use for output
-
printStackTrace
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 isnull
no thread info is printedthrowable
- the throwable whose stack trace is to be printedlocale
- 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 isnull
no thread info is printedthrowable
- the throwable whose stack trace is to be printedstream
-PrintStream
to use for outputlocale
- 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 isnull
no thread info is printedthrowable
- the throwable whose stack trace is to be printedwriter
-PrintWriter
to use for outputlocale
- the local to use for printing
-
getStackTraceString
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 printedlocale
- the local to use for printing- Returns:
- the string containing the supplied throwable and its stack trace.
-
getStackTraceString
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 isnull
no thread info is printedthrowable
- the throwable whose stack trace is to be printedlocale
- 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)
-