java.lang.Object
java.lang.Throwable
java.lang.Exception
com.thetransactioncompany.jsonrpc2.JSONRPC2ParseException
- All Implemented Interfaces:
Serializable
Thrown to indicate an exception during the parsing of a JSON-RPC 2.0 message string.
- See Also:
Field Summary
Modifier and TypeFieldDescriptionprivate intThe parse exception cause type.static final intIndicates a parse exception caused by invalid JSON.static final intIndicates a parse exception caused by a JSON message not conforming to the JSON-RPC 2.0 protocol.private static final longSerial version UID.private StringThe string that could't be parsed.Constructor Summary
ConstructorsConstructorDescriptionJSONRPC2ParseException(String message) Creates a new parse exception with the specified message.JSONRPC2ParseException(String message, int causeType, String unparsableString) Creates a new parse exception with the specified message, cause type and the original string that didn't parse.JSONRPC2ParseException(String message, String unparsableString) Creates a new parse exception with the specified message and the original string that didn't parse.Method Summary
All MethodsModifier and TypeMethodDescriptionintGets the parse exception cause type.Gets original string that caused the parse exception (if specified).Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Field Details
serialVersionUID
PROTOCOL
public static final int PROTOCOLIndicates a parse exception caused by a JSON message not conforming to the JSON-RPC 2.0 protocol.- See Also:
JSON
public static final int JSONIndicates a parse exception caused by invalid JSON.- See Also:
causeType
private int causeTypeThe parse exception cause type. Default isPROTOCOL.unparsableString
The string that could't be parsed.
Constructor Details
JSONRPC2ParseException
JSONRPC2ParseException
JSONRPC2ParseException
Creates a new parse exception with the specified message, cause type and the original string that didn't parse.
Method Details
getCauseType
getUnparsableString
Gets original string that caused the parse exception (if specified).- Returns:
- The string that didn't parse,
nullif none.