Package org.apache.groovy.json.internal
Class Exceptions
java.lang.Object
org.apache.groovy.json.internal.Exceptions
Internal exception helpers used by the JSON parser implementation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRuntime exception used inside the JSON internals to simplify propagation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleandie()Throws a generic internal JSON exception.static <T> TThrows an internal JSON exception with the supplied message.static booleanThrows an internal JSON exception with the supplied message.static <T> TRethrows the supplied exception as an internal JSON exception.static <T> TRethrows the supplied throwable as an internal JSON exception with a message.static voidRethrows the supplied exception as an internal JSON exception.static voidRethrows the supplied throwable as an internal JSON exception with a message.static StringCreates a temporary buffer, appends the supplied messages, and returns the result.static StringAppends messages to the supplied buffer and returns its current contents.static StringFormats an exception and its stack trace for debug output.
-
Constructor Details
-
Exceptions
public Exceptions()
-
-
Method Details
-
die
public static boolean die()Throws a generic internal JSON exception.- Returns:
- never returns normally
-
die
Throws an internal JSON exception with the supplied message.- Parameters:
message- the failure message- Returns:
- never returns normally
-
die
Throws an internal JSON exception with the supplied message.- Type Parameters:
T- the generic return type- Parameters:
clazz- the ignored target type used for generic flowmessage- the failure message- Returns:
- never returns normally
-
handle
Rethrows the supplied exception as an internal JSON exception.- Parameters:
e- the exception to wrap
-
handle
Rethrows the supplied exception as an internal JSON exception.- Type Parameters:
T- the generic return type- Parameters:
clazz- the ignored target type used for generic flowe- the exception to wrap- Returns:
- never returns normally
-
handle
Rethrows the supplied throwable as an internal JSON exception with a message.- Type Parameters:
T- the generic return type- Parameters:
clazz- the ignored target type used for generic flowmessage- the failure messagee- the throwable to wrap- Returns:
- never returns normally
-
handle
Rethrows the supplied throwable as an internal JSON exception with a message.- Parameters:
message- the failure messagee- the throwable to wrap
-
toString
Formats an exception and its stack trace for debug output.- Parameters:
ex- the exception to format- Returns:
- the formatted exception text
-
sputs
Appends messages to the supplied buffer and returns its current contents.- Parameters:
buf- the destination buffermessages- the messages to append- Returns:
- the buffer content after appending the messages
-
sputs
Creates a temporary buffer, appends the supplied messages, and returns the result.- Parameters:
messages- the messages to append- Returns:
- the formatted message text
-