クラス ProtobufJsonFormatMessageConverter

実装されたすべてのインターフェース:
MessageConverterSmartMessageConverter

public class ProtobufJsonFormatMessageConverter extends ProtobufMessageConverter
JSON サポート用の公式 "com.google.protobuf:protobuf-java-util" ライブラリで使用する ProtobufMessageConverter のサブクラス。

最も重要なこととして、このクラスは、JsonFormat ユーティリティを介してカスタム JSON パーサーおよびプリンター構成を可能にします。特別なパーサーまたはプリンター構成が指定されていない場合は、代わりにデフォルトのバリアントが使用されます。

Protobuf 3.x および "com.google.protobuf:protobuf-java-util" 3.x が必要です。3.3 以上を推奨します。

導入:
5.2.2
作成者:
Rossen Stoyanchev
  • コンストラクターの詳細

    • ProtobufJsonFormatMessageConverter

      public ProtobufJsonFormatMessageConverter(@Nullable com.google.protobuf.ExtensionRegistry extensionRegistry)
      JsonFormat.ParserJsonFormat.PrinterExtensionRegistry のデフォルトインスタンスを持つコンストラクター。
    • ProtobufJsonFormatMessageConverter

      public ProtobufJsonFormatMessageConverter(@Nullable com.google.protobuf.util.JsonFormat.Parser parser, @Nullable com.google.protobuf.util.JsonFormat.Printer printer)
      JsonFormat.ParserJsonFormat.Printer の特定のインスタンス、ExtensionRegistry のデフォルトインスタンスを持つコンストラクター。
    • 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)
      JsonFormat.ParserJsonFormat.PrinterExtensionRegistry の特定のインスタンスを持つコンストラクター。