类 Jackson2SockJsMessageCodec
- java.lang.Object
- org.springframework.web.socket.sockjs.frame.AbstractSockJsMessageCodec
- org.springframework.web.socket.sockjs.frame.Jackson2SockJsMessageCodec
- 所有已实现的接口:
SockJsMessageCodec
public class Jackson2SockJsMessageCodec extends AbstractSockJsMessageCodec
A Jackson 2.6+ codec for encoding and decoding SockJS messages.It customizes Jackson's default properties with the following ones:
MapperFeature.DEFAULT_VIEW_INCLUSION
is disabledDeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES
is disabled
Note that Jackson's JSR-310 and Joda-Time support modules will be registered automatically when available (and when Java 8 and Joda-Time themselves are available, respectively).
- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 Jackson2SockJsMessageCodec()
Jackson2SockJsMessageCodec(ObjectMapper objectMapper)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected char[]
applyJsonQuoting(String content)
Apply standard JSON string quoting (see https://www.json.org/).String[]
decode(String content)
Decode the given SockJS message frame.String[]
decodeInputStream(InputStream content)
Decode the given SockJS message frame.从类继承的方法 org.springframework.web.socket.sockjs.frame.AbstractSockJsMessageCodec
encode
构造器详细资料
Jackson2SockJsMessageCodec
public Jackson2SockJsMessageCodec()
Jackson2SockJsMessageCodec
public Jackson2SockJsMessageCodec(ObjectMapper objectMapper)
方法详细资料
decode
@Nullable public String[] decode(String content) throws IOException
从接口复制的说明:SockJsMessageCodec
Decode the given SockJS message frame.- 参数:
content
- the SockJS message frame- 返回:
- an array of messages, or
null
if none - 抛出:
IOException
- if the content could not be parsed
decodeInputStream
@Nullable public String[] decodeInputStream(InputStream content) throws IOException
从接口复制的说明:SockJsMessageCodec
Decode the given SockJS message frame.- 参数:
content
- the SockJS message frame- 返回:
- an array of messages, or
null
if none - 抛出:
IOException
- if the content could not be parsed
applyJsonQuoting
protected char[] applyJsonQuoting(String content)
从类复制的说明:AbstractSockJsMessageCodec
Apply standard JSON string quoting (see https://www.json.org/).