Package io.moderne.jsonrpc.formatter
Class JsonMessageFormatter
java.lang.Object
io.moderne.jsonrpc.formatter.JsonMessageFormatter
- All Implemented Interfaces:
MessageFormatter
-
Constructor Summary
ConstructorsConstructorDescriptionJsonMessageFormatter(com.fasterxml.jackson.databind.Module... modules) JsonMessageFormatter(com.fasterxml.jackson.databind.ObjectMapper mapper) -
Method Summary
Modifier and TypeMethodDescription<T> @Nullable TconvertValue(RawJson value, Type type) voidserialize(JsonRpcMessage message, OutputStream out) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.moderne.jsonrpc.formatter.MessageFormatter
getEncoding
-
Constructor Details
-
JsonMessageFormatter
public JsonMessageFormatter() -
JsonMessageFormatter
public JsonMessageFormatter(com.fasterxml.jackson.databind.Module... modules) -
JsonMessageFormatter
public JsonMessageFormatter(com.fasterxml.jackson.databind.ObjectMapper mapper)
-
-
Method Details
-
deserialize
- Specified by:
deserializein interfaceMessageFormatter- Throws:
IOException
-
serialize
- Specified by:
serializein interfaceMessageFormatter- Throws:
IOException
-
convertValue
Description copied from interface:MessageFormatterConvert aRawJsonvalue (typically from JSON-RPCparamsorresult) to a typed POJO. Implementations decide how to handle each possible wrapped representation: a POJO awaiting serialization, a parser-format-specific buffer captured duringdeserialize, ornull.- Specified by:
convertValuein interfaceMessageFormatter
-