public class ProtobufJsonFormatMessageConverter extends ProtobufMessageConverter
ProtobufMessageConverter
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.
DEFAULT_CHARSET, PROTOBUF
logger
Constructor and Description |
---|
ProtobufJsonFormatMessageConverter(com.google.protobuf.ExtensionRegistry extensionRegistry)
Constructor with default instances of
JsonFormat.Parser , JsonFormat.Printer , and ExtensionRegistry . |
ProtobufJsonFormatMessageConverter(com.google.protobuf.util.JsonFormat.Parser parser,
com.google.protobuf.util.JsonFormat.Printer printer)
Constructor with given instances of
JsonFormat.Parser , JsonFormat.Printer , and a default instance of ExtensionRegistry . |
ProtobufJsonFormatMessageConverter(com.google.protobuf.util.JsonFormat.Parser parser,
com.google.protobuf.util.JsonFormat.Printer printer,
com.google.protobuf.ExtensionRegistry extensionRegistry)
Constructor with given instances of
JsonFormat.Parser , JsonFormat.Printer , and ExtensionRegistry . |
canConvertTo, convertFromInternal, convertToInternal, supports
addSupportedMimeTypes, canConvertFrom, fromMessage, fromMessage, getContentTypeResolver, getDefaultContentType, getMimeType, getSerializedPayloadClass, getSupportedMimeTypes, isStrictContentTypeMatch, setContentTypeResolver, setSerializedPayloadClass, setStrictContentTypeMatch, supportsMimeType, toMessage, toMessage
public ProtobufJsonFormatMessageConverter(@Nullable com.google.protobuf.ExtensionRegistry extensionRegistry)
JsonFormat.Parser
, JsonFormat.Printer
, and ExtensionRegistry
.public ProtobufJsonFormatMessageConverter(@Nullable com.google.protobuf.util.JsonFormat.Parser parser, @Nullable com.google.protobuf.util.JsonFormat.Printer printer)
JsonFormat.Parser
, JsonFormat.Printer
, and a default instance of ExtensionRegistry
.public ProtobufJsonFormatMessageConverter(@Nullable com.google.protobuf.util.JsonFormat.Parser parser, @Nullable com.google.protobuf.util.JsonFormat.Printer printer, @Nullable com.google.protobuf.ExtensionRegistry extensionRegistry)
JsonFormat.Parser
, JsonFormat.Printer
, and ExtensionRegistry
.