public class JsonException extends DataFormatException
Exception thrown when an error occurs during the parsing of data represented in JSON format.
Modifier | Constructor and Description |
---|---|
|
JsonException()
Default constructor.
|
protected |
JsonException(java.lang.String message,
java.lang.Throwable cause) |
Modifier and Type | Method and Description |
---|---|
static JsonException |
cannotParse(java.lang.String value,
java.lang.String type)
Return an exception to be thrown when a value cannot be parsed from JSON format.
|
static JsonException |
withCause(java.lang.RuntimeException cause)
Return a new exception with the specified root cause.
|
static JsonException |
withMessage(java.lang.String message)
Return a new exception with the specified message text.
|
getSafeMessage, safe, setSafeMessage
getCause, getMessage, setCause, setMessage, toString
protected JsonException(java.lang.String message, java.lang.Throwable cause)
public JsonException()
Default constructor.
public static JsonException cannotParse(java.lang.String value, java.lang.String type)
Return an exception to be thrown when a value cannot be parsed from JSON format.
value
- Text of value that could not be parsed.type
- Name of expected data type.public static JsonException withCause(java.lang.RuntimeException cause)
Return a new exception with the specified root cause.
cause
- Root cause.public static JsonException withMessage(java.lang.String message)
Return a new exception with the specified message text.
message
- Message text.