Package | Description |
---|---|
com.thetransactioncompany.jsonrpc2 |
Classes to represent, parse and serialise JSON-RPC 2.0 requests,
notifications and responses.
|
com.thetransactioncompany.jsonrpc2.util |
Utility classes for typed retrieval of JSON-RPC 2.0 request parameters on the
server side.
|
Modifier and Type | Field and Description |
---|---|
static JSONRPC2Error |
JSONRPC2Error.INTERNAL_ERROR
Internal JSON-RPC 2.0 error (-32603).
|
static JSONRPC2Error |
JSONRPC2Error.INVALID_PARAMS
Invalid parameters error (-32602).
|
static JSONRPC2Error |
JSONRPC2Error.INVALID_REQUEST
Invalid JSON-RPC 2.0 request error (-32600).
|
static JSONRPC2Error |
JSONRPC2Error.METHOD_NOT_FOUND
Method not found error (-32601).
|
static JSONRPC2Error |
JSONRPC2Error.PARSE_ERROR
JSON parse error (-32700).
|
Modifier and Type | Method and Description |
---|---|
static JSONRPC2Error |
JSONRPC2Error.appendMessage(JSONRPC2Error err,
String apx)
Deprecated.
|
JSONRPC2Error |
JSONRPC2Error.appendMessage(String apx)
Appends the specified string to the message of this JSON-RPC 2.0
error.
|
JSONRPC2Error |
JSONRPC2Response.getError()
Gets the error object indicating the cause of the request failure.
|
static JSONRPC2Error |
JSONRPC2Error.setData(JSONRPC2Error err,
Object data)
Deprecated.
|
JSONRPC2Error |
JSONRPC2Error.setData(Object data)
Sets the specified data to a JSON-RPC 2.0 error.
|
Modifier and Type | Method and Description |
---|---|
static JSONRPC2Error |
JSONRPC2Error.appendMessage(JSONRPC2Error err,
String apx)
Deprecated.
|
static JSONRPC2Error |
JSONRPC2Error.setData(JSONRPC2Error err,
Object data)
Deprecated.
|
void |
JSONRPC2Response.setError(JSONRPC2Error error)
Indicates a failed JSON-RPC 2.0 request and sets the error details.
|
Constructor and Description |
---|
JSONRPC2Response(JSONRPC2Error error,
Object id)
Creates a new JSON-RPC 2.0 response to a failed request.
|
Modifier and Type | Method and Description |
---|---|
void |
PositionalParamsRetriever.ensureParam(int position)
Throws a
JSONRPC2Error.INVALID_PARAMS exception if there is
no parameter at the specified position. |
<T> void |
PositionalParamsRetriever.ensureParam(int position,
Class<T> clazz)
Throws a
JSONRPC2Error.INVALID_PARAMS exception if there is
no parameter at the specified position, its value is null ,
or its type doesn't map to the specified. |
<T> void |
PositionalParamsRetriever.ensureParam(int position,
Class<T> clazz,
boolean allowNull)
Throws a
JSONRPC2Error.INVALID_PARAMS exception if there is
no parameter at the specified position or its type doesn't map to
the specified. |
void |
NamedParamsRetriever.ensureParam(String name)
Throws a
JSONRPC2Error.INVALID_PARAMS exception if there is
no parameter by the specified name. |
<T> void |
NamedParamsRetriever.ensureParam(String name,
Class<T> clazz)
Throws a
JSONRPC2Error.INVALID_PARAMS exception if there is
no parameter by the specified name, its value is null , or
its type doesn't map to the specified. |
<T> void |
NamedParamsRetriever.ensureParam(String name,
Class<T> clazz,
boolean allowNull)
Throws a
JSONRPC2Error.INVALID_PARAMS exception if there is
no parameter by the specified name or its type doesn't map to the
specified. |
void |
PositionalParamsRetriever.ensureParameter(int position)
Deprecated.
|
<T> void |
PositionalParamsRetriever.ensureParameter(int position,
Class<T> clazz)
Deprecated.
|
<T> void |
PositionalParamsRetriever.ensureParameter(int position,
Class<T> clazz,
boolean allowNull)
Deprecated.
|
void |
NamedParamsRetriever.ensureParameter(String name)
Deprecated.
|
<T> void |
NamedParamsRetriever.ensureParameter(String name,
Class<T> clazz)
Deprecated.
|
<T> void |
NamedParamsRetriever.ensureParameter(String name,
Class<T> clazz,
boolean allowNull)
Deprecated.
|
void |
NamedParamsRetriever.ensureParameters(String[] mandatoryNames)
Deprecated.
|
void |
NamedParamsRetriever.ensureParameters(String[] mandatoryNames,
String[] optionalNames)
Deprecated.
|
void |
NamedParamsRetriever.ensureParams(String[] mandatoryNames)
Throws a
JSONRPC2Error.INVALID_PARAMS if the specified
names aren't present in the parameters, or names outside the
specified are contained. |
void |
NamedParamsRetriever.ensureParams(String[] mandatoryNames,
String[] optionalNames)
Throws a
JSONRPC2Error.INVALID_PARAMS if the specified
mandatory names aren't contained in the parameters, or names outside
the specified mandatory and optional are present. |
Object |
PositionalParamsRetriever.get(int position)
Retrieves the specified parameter which can be of any type.
|
<T> T |
PositionalParamsRetriever.get(int position,
Class<T> clazz)
Retrieves the specified parameter which must map to the provided
class (use the appropriate wrapper class for primitive types).
|
<T> T |
PositionalParamsRetriever.get(int position,
Class<T> clazz,
boolean allowNull)
Retrieves the specified parameter which must map to the provided
class (use the appropriate wrapper class for primitive types).
|
Object |
NamedParamsRetriever.get(String name)
Retrieves the specified parameter which can be of any type.
|
<T> T |
NamedParamsRetriever.get(String name,
Class<T> clazz)
Retrieves the specified parameter which must map to the provided
class (use the appropriate wrapper class for primitive types).
|
<T> T |
NamedParamsRetriever.get(String name,
Class<T> clazz,
boolean allowNull)
Retrieves the specified parameter which must map to the provided
class (use the appropriate wrapper class for primitive types).
|
boolean |
PositionalParamsRetriever.getBoolean(int position)
Retrieves the specified boolean (maps from JSON true/false)
parameter.
|
boolean |
NamedParamsRetriever.getBoolean(String name)
Retrieves the specified boolean (maps from JSON true/false)
parameter.
|
double |
PositionalParamsRetriever.getDouble(int position)
Retrieves the specified numeric parameter as a
double . |
double |
NamedParamsRetriever.getDouble(String name)
Retrieves the specified numeric parameter as a
double . |
<T extends Enum<T>> |
PositionalParamsRetriever.getEnum(int position,
Class<T> enumClass)
Retrieves the specified enumerated parameter (from a JSON string
that has a predefined set of possible values).
|
<T extends Enum<T>> |
PositionalParamsRetriever.getEnum(int position,
Class<T> enumClass,
boolean ignoreCase)
Retrieves the specified enumerated parameter (from a JSON string
that has a predefined set of possible values), allowing for a case
insensitive match.
|
<T extends Enum<T>> |
NamedParamsRetriever.getEnum(String name,
Class<T> enumClass)
Retrieves the specified enumerated parameter (from a JSON string
that has a predefined set of possible values).
|
<T extends Enum<T>> |
NamedParamsRetriever.getEnum(String name,
Class<T> enumClass,
boolean ignoreCase)
Retrieves the specified enumerated parameter (from a JSON string
that has a predefined set of possible values), allowing for a case
insensitive match.
|
String |
PositionalParamsRetriever.getEnumString(int position,
String[] enumStrings)
Retrieves the specified enumerated string parameter.
|
String |
PositionalParamsRetriever.getEnumString(int position,
String[] enumStrings,
boolean ignoreCase)
Retrieves the specified enumerated string parameter, allowing for a
case insenstive match.
|
String |
NamedParamsRetriever.getEnumString(String name,
String[] enumStrings)
Retrieves the specified enumerated string parameter.
|
String |
NamedParamsRetriever.getEnumString(String name,
String[] enumStrings,
boolean ignoreCase)
Retrieves the specified enumerated string parameter, allowing for a
case insenstive match.
|
float |
PositionalParamsRetriever.getFloat(int position)
Retrieves the specified numeric parameter as a
float . |
float |
NamedParamsRetriever.getFloat(String name)
Retrieves the specified numeric parameter as a
float . |
int |
PositionalParamsRetriever.getInt(int position)
Retrieves the specified numeric parameter as an
int . |
int |
NamedParamsRetriever.getInt(String name)
Retrieves the specified numeric parameter as an
int . |
List<Object> |
PositionalParamsRetriever.getList(int position)
Retrieves the specified list (maps from JSON array) parameter.
|
List<Object> |
PositionalParamsRetriever.getList(int position,
boolean allowNull)
Retrieves the specified list (maps from JSON array) parameter.
|
List<Object> |
NamedParamsRetriever.getList(String name)
Retrieves the specified list (maps from JSON array) parameter.
|
List<Object> |
NamedParamsRetriever.getList(String name,
boolean allowNull)
Retrieves the specified list (maps from JSON array) parameter.
|
long |
PositionalParamsRetriever.getLong(int position)
Retrieves the specified numeric parameter as a
long . |
long |
NamedParamsRetriever.getLong(String name)
Retrieves the specified numeric parameter as a
long . |
Map<String,Object> |
PositionalParamsRetriever.getMap(int position)
Retrieves the specified map (maps from JSON object) parameter.
|
Map<String,Object> |
PositionalParamsRetriever.getMap(int position,
boolean allowNull)
Retrieves the specified map (maps from JSON object) parameter.
|
Map<String,Object> |
NamedParamsRetriever.getMap(String name)
Retrieves the specified map (maps from JSON object) parameter.
|
Map<String,Object> |
NamedParamsRetriever.getMap(String name,
boolean allowNull)
Retrieves the specified map (maps from JSON object) parameter.
|
<T> T |
PositionalParamsRetriever.getOpt(int position,
Class<T> clazz,
boolean allowNull,
T defaultValue)
Retrieves the specified optional parameter which must map to the
provided class (use the appropriate wrapper class for primitive
types).
|
<T> T |
PositionalParamsRetriever.getOpt(int position,
Class<T> clazz,
T defaultValue)
Retrieves the specified optional parameter which must map to the
provided class (use the appropriate wrapper class for primitive
types).
|
<T> T |
NamedParamsRetriever.getOpt(String name,
Class<T> clazz,
boolean allowNull,
T defaultValue)
Retrieves the specified optional parameter which must map to the
provided class (use the appropriate wrapper class for primitive
types).
|
<T> T |
NamedParamsRetriever.getOpt(String name,
Class<T> clazz,
T defaultValue)
Retrieves the specified optional parameter which must map to the
provided class (use the appropriate wrapper class for primitive
types).
|
boolean |
PositionalParamsRetriever.getOptBoolean(int position,
boolean defaultValue)
Retrieves the specified optional boolean (maps from JSON true/false)
parameter.
|
boolean |
NamedParamsRetriever.getOptBoolean(String name,
boolean defaultValue)
Retrieves the specified optional boolean (maps from JSON true/false)
parameter.
|
double |
PositionalParamsRetriever.getOptDouble(int position,
double defaultValue)
Retrieves the specified optional numeric parameter as a
double . |
double |
NamedParamsRetriever.getOptDouble(String name,
double defaultValue)
Retrieves the specified optional numeric parameter as a
double . |
<T extends Enum<T>> |
PositionalParamsRetriever.getOptEnum(int position,
Class<T> enumClass,
String defaultValue)
Retrieves the specified optional enumerated parameter (from a JSON
string that has a predefined set of possible values).
|
<T extends Enum<T>> |
PositionalParamsRetriever.getOptEnum(int position,
Class<T> enumClass,
String defaultValue,
boolean ignoreCase)
Retrieves the specified optional enumerated parameter (from a JSON
string that has a predefined set of possible values), allowing for a
case insenstive match.
|
<T extends Enum<T>> |
NamedParamsRetriever.getOptEnum(String name,
Class<T> enumClass,
T defaultValue)
Retrieves the specified optional enumerated parameter (from a JSON
string that has a predefined set of possible values).
|
<T extends Enum<T>> |
NamedParamsRetriever.getOptEnum(String name,
Class<T> enumClass,
T defaultValue,
boolean ignoreCase)
Retrieves the specified optional enumerated parameter (from a JSON
string that has a predefined set of possible values), allowing for
a case insenstive match.
|
String |
PositionalParamsRetriever.getOptEnumString(int position,
String[] enumStrings,
String defaultValue)
Retrieves the specified optional enumerated string parameter.
|
String |
PositionalParamsRetriever.getOptEnumString(int position,
String[] enumStrings,
String defaultValue,
boolean ignoreCase)
Retrieves the specified optional enumerated string parameter,
allowing for a case insenstive match.
|
String |
NamedParamsRetriever.getOptEnumString(String name,
String[] enumStrings,
String defaultValue)
Retrieves the specified optional enumerated string parameter.
|
String |
NamedParamsRetriever.getOptEnumString(String name,
String[] enumStrings,
String defaultValue,
boolean ignoreCase)
Retrieves the specified optional enumerated string parameter,
allowing for a case insenstive match.
|
float |
PositionalParamsRetriever.getOptFloat(int position,
float defaultValue)
Retrieves the specified optional numeric parameter as a
float . |
float |
NamedParamsRetriever.getOptFloat(String name,
float defaultValue)
Retrieves the specified optional numeric parameter as a
float . |
int |
PositionalParamsRetriever.getOptInt(int position,
int defaultValue)
Retrieves the specified optional numeric parameter as an
int . |
int |
NamedParamsRetriever.getOptInt(String name,
int defaultValue)
Retrieves the specified optional numeric parameter as an
int . |
List<Object> |
PositionalParamsRetriever.getOptList(int position,
boolean allowNull,
List<Object> defaultValue)
Retrieves the specified optional list (maps from JSON array)
parameter.
|
List<Object> |
PositionalParamsRetriever.getOptList(int position,
List<Object> defaultValue)
Retrieves the specified optional list (maps from JSON array)
parameter.
|
List<Object> |
NamedParamsRetriever.getOptList(String name,
boolean allowNull,
List<Object> defaultValue)
Retrieves the specified optional list (maps from JSON array)
parameter.
|
List<Object> |
NamedParamsRetriever.getOptList(String name,
List<Object> defaultValue)
Retrieves the specified optional list (maps from JSON array)
parameter.
|
long |
PositionalParamsRetriever.getOptLong(int position,
long defaultValue)
Retrieves the specified optional numeric parameter as a
long . |
long |
NamedParamsRetriever.getOptLong(String name,
long defaultValue)
Retrieves the specified optional numeric parameter as a
long . |
Map<String,Object> |
PositionalParamsRetriever.getOptMap(int position,
boolean allowNull,
Map<String,Object> defaultValue)
Retrieves the specified optional map (maps from JSON object)
parameter.
|
Map<String,Object> |
PositionalParamsRetriever.getOptMap(int position,
Map<String,Object> defaultValue)
Retrieves the specified optional map (maps from JSON object)
parameter.
|
Map<String,Object> |
NamedParamsRetriever.getOptMap(String name,
boolean allowNull,
Map<String,Object> defaultValue)
Retrieves the specified optional map (maps from JSON object)
parameter.
|
Map<String,Object> |
NamedParamsRetriever.getOptMap(String name,
Map<String,Object> defaultValue)
Retrieves the specified optional map (maps from JSON object)
parameter.
|
String |
PositionalParamsRetriever.getOptString(int position,
boolean allowNull,
String defaultValue)
Retrieves the specified optional string parameter.
|
String |
PositionalParamsRetriever.getOptString(int position,
String defaultValue)
Retrieves the specified optional string parameter.
|
String |
NamedParamsRetriever.getOptString(String name,
boolean allowNull,
String defaultValue)
Retrieves the specified optional string parameter.
|
String |
NamedParamsRetriever.getOptString(String name,
String defaultValue)
Retrieves the specified optional string parameter.
|
String[] |
PositionalParamsRetriever.getOptStringArray(int position,
boolean allowNull,
String[] defaultValue)
Retrieves the specified optional string array (maps from JSON array
of strings) parameter.
|
String[] |
PositionalParamsRetriever.getOptStringArray(int position,
String[] defaultValue)
Retrieves the specified optional string array (maps from JSON array
of strings) parameter.
|
String[] |
NamedParamsRetriever.getOptStringArray(String name,
boolean allowNull,
String[] defaultValue)
Retrieves the specified optional string array (maps from JSON array
of strings) parameter.
|
String[] |
NamedParamsRetriever.getOptStringArray(String name,
String[] defaultValue)
Retrieves the specified optional string array (maps from JSON array
of strings) parameter.
|
String |
PositionalParamsRetriever.getString(int position)
Retrieves the specified string parameter.
|
String |
PositionalParamsRetriever.getString(int position,
boolean allowNull)
Retrieves the specified string parameter.
|
String |
NamedParamsRetriever.getString(String name)
Retrieves the specified string parameter.
|
String |
NamedParamsRetriever.getString(String name,
boolean allowNull)
Retrieves the specified string parameter.
|
String[] |
PositionalParamsRetriever.getStringArray(int position)
Retrieves the specified string array (maps from JSON array of
strings) parameter.
|
String[] |
PositionalParamsRetriever.getStringArray(int position,
boolean allowNull)
Retrieves the specified string array (maps from JSON array of
strings) parameter.
|
String[] |
NamedParamsRetriever.getStringArray(String name)
Retrieves the specified string array (maps from JSON array of
strings) parameter.
|
String[] |
NamedParamsRetriever.getStringArray(String name,
boolean allowNull)
Retrieves the specified string array (maps from JSON array of
strings) parameter.
|
Copyright © 2015 The Transaction Company. All Rights Reserved.