クラス AbstractEncoderMethodReturnValueHandler

java.lang.ObjectSE
org.springframework.messaging.handler.invocation.reactive.AbstractEncoderMethodReturnValueHandler
実装されたすべてのインターフェース:
HandlerMethodReturnValueHandler
既知の直属サブクラス
RSocketPayloadReturnValueHandler

public abstract class AbstractEncoderMethodReturnValueHandler extends ObjectSE implements HandlerMethodReturnValueHandler
構成された Encoder を介して Flux<DataBuffer> への戻り値をエンコードする戻り値ハンドラーの基本クラス。

サブクラスは、結果のエンコードされたコンテンツを処理するために、抽象メソッド handleEncodedContent(reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer>, org.springframework.core.MethodParameter, org.springframework.messaging.Message<?>) を実装する必要があります。

このハンドラーは、supportsReturnType(org.springframework.core.MethodParameter) がすべてのメソッドパラメーター型に対して true を返すため、最後に並べる必要があります。

導入:
5.2
作成者:
Rossen Stoyanchev
  • フィールドの詳細

    • logger

      protected final Log logger
  • コンストラクターの詳細

  • メソッドの詳細

    • getEncoders

      public ListSE<Encoder<?>> getEncoders()
      構成されたエンコーダー。
    • getAdapterRegistry

      public ReactiveAdapterRegistry getAdapterRegistry()
      構成されたアダプターレジストリ。
    • supportsReturnType

      public boolean supportsReturnType(MethodParameter returnType)
      インターフェースからコピーされた説明: HandlerMethodReturnValueHandler
      指定されたメソッドの戻り型がこのハンドラーでサポートされているかどうか。
      次で指定:
      インターフェース HandlerMethodReturnValueHandlersupportsReturnType 
      パラメーター:
      returnType - チェックするメソッドの戻り値の型
      戻り値:
      このハンドラーが提供された戻り値の型をサポートする場合、true。それ以外の場合は false 
    • handleReturnValue

      public reactor.core.publisher.Mono<VoidSE> handleReturnValue(@Nullable ObjectSE returnValue, MethodParameter returnType, Message<?> message)
      インターフェースからコピーされた説明: HandlerMethodReturnValueHandler
      指定された戻り値を処理します。
      次で指定:
      インターフェース HandlerMethodReturnValueHandlerhandleReturnValue 
      パラメーター:
      returnValue - ハンドラーメソッドから返された値
      returnType - 戻り値の型。この型は以前に HandlerMethodReturnValueHandler.supportsReturnType(MethodParameter) に渡されていて、true を返している必要があります。
      戻り値:
      Mono<Void> は、処理が完了したことを示します。
    • handleEncodedContent

      protected abstract reactor.core.publisher.Mono<VoidSE> handleEncodedContent(reactor.core.publisher.Flux<DataBuffer> encodedContent, MethodParameter returnType, Message<?> message)
      サブクラスは、このメソッドを実装して、メッセージの作成や送信などの何らかの方法でエンコードされた値を処理します。
      パラメーター:
      encodedContent - エンコードされたコンテンツ。各 DataBuffer は、HandlerMethod から返された 1 つの値(ペイロード)の完全に集約され、エンコードされたコンテンツを表します。
      returnType - データを生成したハンドラーメソッドの戻り型
      message - ハンドラーメソッドによって処理される入力メッセージ
      戻り値:
      取り扱い完了 Mono<Void> 
    • handleNoContent

      protected abstract reactor.core.publisher.Mono<VoidSE> handleNoContent(MethodParameter returnType, Message<?> message)
      null 戻り値に対して呼び出されます。これは、void メソッド、または void でパラメーター化された非同期型を返すメソッドを意味する場合があります。
      パラメーター:
      returnType - データを生成したハンドラーメソッドの戻り型
      message - ハンドラーメソッドによって処理される入力メッセージ
      戻り値:
      取り扱い完了 Mono<Void>