spring-framework / org.springframework.http.converter.protobuf / ProtobufJsonFormatHttpMessageConverter

ProtobufJsonFormatHttpMessageConverter

open class ProtobufJsonFormatHttpMessageConverter : ProtobufHttpMessageConverter

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.

Author
Juergen Hoeller

Since
5.0

See Also
JsonFormat#parser()JsonFormat#printer()#ProtobufJsonFormatHttpMessageConverter(JsonFormat.Parser, JsonFormat.Printer)

Constructors

<init>

ProtobufJsonFormatHttpMessageConverter()

Construct a new ProtobufJsonFormatHttpMessageConverter with default JsonFormat.Parser and JsonFormat.Printer configuration.

ProtobufJsonFormatHttpMessageConverter(parser: Parser, printer: Printer)

Construct a new ProtobufJsonFormatHttpMessageConverter with the given JsonFormat.Parser and JsonFormat.Printer configuration.

ProtobufJsonFormatHttpMessageConverter(parser: Parser, printer: Printer, registryInitializer: ExtensionRegistryInitializer)

Construct a new ProtobufJsonFormatHttpMessageConverter with the given JsonFormat.Parser and JsonFormat.Printer configuration, also accepting an initializer that allows the registration of message extensions