Class JacksonJsonSockJsMessageCodec
java.lang.Object
org.springframework.web.socket.sockjs.frame.AbstractSockJsMessageCodec
org.springframework.web.socket.sockjs.frame.JacksonJsonSockJsMessageCodec
- All Implemented Interfaces:
SockJsMessageCodec
A Jackson 3.x codec for encoding and decoding SockJS messages.
The default constructor loads JacksonModule
s
found by MapperBuilder.findModules(ClassLoader)
.
- Since:
- 7.0
- Author:
- Sebastien Deleuze
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new instance with aJsonMapper
customized with theJacksonModule
s found byMapperBuilder.findModules(ClassLoader)
.JacksonJsonSockJsMessageCodec
(ObjectMapper objectMapper) Construct a new instance with the providedObjectMapper
. -
Method Summary
Modifier and TypeMethodDescriptionprotected char[]
applyJsonQuoting
(String content) Apply standard JSON string quoting (see json.org).Decode the given SockJS message frame.decodeInputStream
(InputStream content) Decode the given SockJS message frame.Methods inherited from class org.springframework.web.socket.sockjs.frame.AbstractSockJsMessageCodec
encode
-
Constructor Details
-
JacksonJsonSockJsMessageCodec
public JacksonJsonSockJsMessageCodec()Construct a new instance with aJsonMapper
customized with theJacksonModule
s found byMapperBuilder.findModules(ClassLoader)
. -
JacksonJsonSockJsMessageCodec
Construct a new instance with the providedObjectMapper
.- See Also:
-
-
Method Details
-
decode
Description copied from interface:SockJsMessageCodec
Decode the given SockJS message frame.- Parameters:
content
- the SockJS message frame- Returns:
- an array of messages, or
null
if none
-
decodeInputStream
Description copied from interface:SockJsMessageCodec
Decode the given SockJS message frame.- Parameters:
content
- the SockJS message frame- Returns:
- an array of messages, or
null
if none
-
applyJsonQuoting
Description copied from class:AbstractSockJsMessageCodec
Apply standard JSON string quoting (see json.org).- Specified by:
applyJsonQuoting
in classAbstractSockJsMessageCodec
-