类 ProtobufJsonFormatMessageConverter
- java.lang.Object
- org.springframework.messaging.converter.AbstractMessageConverter
- org.springframework.messaging.converter.ProtobufMessageConverter
- org.springframework.messaging.converter.ProtobufJsonFormatMessageConverter
- 所有已实现的接口:
MessageConverter
,SmartMessageConverter
public class ProtobufJsonFormatMessageConverter extends ProtobufMessageConverter
Subclass ofProtobufMessageConverter
for use with the official"com.google.protobuf:protobuf-java-util"
library for JSON support.Most importantly, this class allows for custom JSON parser and printer configurations through the
JsonFormat
utility. If no special parser or printer configuration is given, default variants will be used instead.Requires Protobuf 3.x and
"com.google.protobuf:protobuf-java-util"
3.x, with 3.3 or higher recommended.- 从以下版本开始:
- 5.2.2
- 作者:
- Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.messaging.converter.ProtobufMessageConverter
DEFAULT_CHARSET, PROTOBUF
从类继承的字段 org.springframework.messaging.converter.AbstractMessageConverter
logger
构造器概要
构造器 构造器 说明 ProtobufJsonFormatMessageConverter(com.google.protobuf.ExtensionRegistry extensionRegistry)
Constructor with default instances ofJsonFormat.Parser
,JsonFormat.Printer
, andExtensionRegistry
.ProtobufJsonFormatMessageConverter(com.google.protobuf.util.JsonFormat.Parser parser, com.google.protobuf.util.JsonFormat.Printer printer)
Constructor with given instances ofJsonFormat.Parser
,JsonFormat.Printer
, and a default instance ofExtensionRegistry
.ProtobufJsonFormatMessageConverter(com.google.protobuf.util.JsonFormat.Parser parser, com.google.protobuf.util.JsonFormat.Printer printer, com.google.protobuf.ExtensionRegistry extensionRegistry)
Constructor with given instances ofJsonFormat.Parser
,JsonFormat.Printer
, andExtensionRegistry
.
方法概要
从类继承的方法 org.springframework.messaging.converter.ProtobufMessageConverter
canConvertTo, convertFromInternal, convertToInternal, supports
从类继承的方法 org.springframework.messaging.converter.AbstractMessageConverter
addSupportedMimeTypes, canConvertFrom, fromMessage, fromMessage, getContentTypeResolver, getDefaultContentType, getMimeType, getSerializedPayloadClass, getSupportedMimeTypes, isStrictContentTypeMatch, setContentTypeResolver, setSerializedPayloadClass, setStrictContentTypeMatch, supportsMimeType, toMessage, toMessage
构造器详细资料
ProtobufJsonFormatMessageConverter
public ProtobufJsonFormatMessageConverter(@Nullable com.google.protobuf.ExtensionRegistry extensionRegistry)
Constructor with default instances ofJsonFormat.Parser
,JsonFormat.Printer
, andExtensionRegistry
.
ProtobufJsonFormatMessageConverter
public ProtobufJsonFormatMessageConverter(@Nullable com.google.protobuf.util.JsonFormat.Parser parser, @Nullable com.google.protobuf.util.JsonFormat.Printer printer)
Constructor with given instances ofJsonFormat.Parser
,JsonFormat.Printer
, and a default instance ofExtensionRegistry
.
ProtobufJsonFormatMessageConverter
public ProtobufJsonFormatMessageConverter(@Nullable com.google.protobuf.util.JsonFormat.Parser parser, @Nullable com.google.protobuf.util.JsonFormat.Printer printer, @Nullable com.google.protobuf.ExtensionRegistry extensionRegistry)
Constructor with given instances ofJsonFormat.Parser
,JsonFormat.Printer
, andExtensionRegistry
.