クラス ProtobufHttpMessageConverter

java.lang.ObjectSE
org.springframework.http.converter.AbstractHttpMessageConverter<com.google.protobuf.Message>
org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter
実装されたすべてのインターフェース:
HttpMessageConverter<com.google.protobuf.Message>
既知の直属サブクラス
ProtobufJsonFormatHttpMessageConverter

public class ProtobufHttpMessageConverter extends AbstractHttpMessageConverter<com.google.protobuf.Message>
Google プロトコルバッファを使用して com.google.protobuf.Messages を読み書きする HttpMessageConverter

Message Java クラスを生成するには、protoc バイナリをインストールする必要があります。

このコンバーターは、デフォルトで公式の "com.google.protobuf:protobuf-java" ライブラリで "application/x-protobuf" および "text/plain" をサポートします。クラスパス上の次の追加ライブラリのいずれかを使用して、他の形式をサポートできます。

  •  "com.googlecode.protobuf-java-format:protobuf-java-format" サードパーティライブラリを使用した "application/json""application/xml""text/html" (書き込み専用)
  • Protobuf 3 の公式 "com.google.protobuf:protobuf-java-util" と "application/json" (構成可能なバリアントについては、ProtobufJsonFormatHttpMessageConverter を参照してください)

Protobuf 2.6 以上(およびフォーマットには Protobuf Java Format 1.4 以上)が必要です。このコンバーターは、Protobuf 2 ベースの protobuf-java-format が存在しない場合、Protobuf 3 およびそのデフォルトの protobuf-java-util JSON 形式に自動適応します。ただし、Protobuf 3 でより明示的な JSON セットアップを行うには、ProtobufJsonFormatHttpMessageConverter を検討してください。

導入:
4.1
作成者:
Alex Antonov, Brian Clozel, Juergen Hoeller, Sebastien Deleuze
関連事項: