Top Description Fields Constructors Methods
org.springframework.http.converter.protobuf

public Class ProtobufJsonFormatHttpMessageConverter

extends ProtobufHttpMessageConverter
Class Inheritance
Imports
com.google.protobuf.ExtensionRegistry, com.google.protobuf.util.JsonFormat, org.springframework.lang.Nullable

Subclass of ProtobufHttpMessageConverter which enforces the use of Protobuf 3 and its official library "com.google.protobuf:protobuf-java-util" for JSON processing.

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.

Authors
Juergen Hoeller, Sebastien Deleuze
Since
5.0
See Also
JsonFormat#parser(), JsonFormat#printer(), ProtobufJsonFormatHttpMessageConverter(com.google.protobuf.util.JsonFormat.Parser, com.google.protobuf.util.JsonFormat.Printer)

Field Summary

Inherited from org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter:
DEFAULT_CHARSETextensionRegistryPROTOBUFX_PROTOBUF_MESSAGE_HEADERX_PROTOBUF_SCHEMA_HEADER

Constructor Summary

AccessConstructor and Description
public
public
ProtobufJsonFormatHttpMessageConverter(JsonFormat.Parser parser, JsonFormat.Printer printer)

Constructor with given instances of JsonFormat.Parser, JsonFormat.Printer, and a default instance of ExtensionRegistry.

public

Method Summary

Inherited from org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter:
canWritegetDefaultContentTypereadInternalsupportssupportsRepeatableWriteswriteInternal

Constructor Detail

ProtobufJsonFormatHttpMessageConverterback to summary
public ProtobufJsonFormatHttpMessageConverter()

Constructor with default instances of JsonFormat.Parser, JsonFormat.Printer, and ExtensionRegistry.

ProtobufJsonFormatHttpMessageConverterback to summary
public ProtobufJsonFormatHttpMessageConverter(JsonFormat.Parser parser, JsonFormat.Printer printer)

Constructor with given instances of JsonFormat.Parser, JsonFormat.Printer, and a default instance of ExtensionRegistry.

ProtobufJsonFormatHttpMessageConverterback to summary
public ProtobufJsonFormatHttpMessageConverter(JsonFormat.Parser parser, JsonFormat.Printer printer, ExtensionRegistry extensionRegistry)

Constructor with given instances of JsonFormat.Parser, JsonFormat.Printer, and ExtensionRegistry.