Package eu.woolplatform.utils.json.rpc
Class JsonRpcMessage
- java.lang.Object
-
- eu.woolplatform.utils.json.rpc.JsonRpcMessage
-
- Direct Known Subclasses:
JsonRpcNotification,JsonRpcRequest,JsonRpcResponse
public abstract class JsonRpcMessage extends Object
This is the base class for a JSON-RPC 2.0 message. There are three subclasses:
-
-
Constructor Summary
Constructors Constructor Description JsonRpcMessage()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static JsonRpcMessageread(Map<?,?> map)Reads a JSON-RPC 2.0 message from the specified map, which should represent a JSON object.StringtoString()abstract voidwrite(Writer out)Writes this message as a JSON string to the specified writer.
-
-
-
Method Detail
-
write
public abstract void write(Writer out) throws IOException
Writes this message as a JSON string to the specified writer.- Parameters:
out- the writer- Throws:
IOException- if a writing error occurs
-
read
public static JsonRpcMessage read(Map<?,?> map) throws ParseException
Reads a JSON-RPC 2.0 message from the specified map, which should represent a JSON object.- Parameters:
map- the map- Returns:
- the message
- Throws:
ParseException- if the map is not a valid JSON-RPC message
-
-