T
- 要素型 public abstract class AbstractDataBufferDecoder<T> extends AbstractDecoder<T>
DataBuffer
をターゲット要素型に直接デコードできる Decoder
実装の抽象基本クラス。 サブクラスは decodeDataBuffer(org.springframework.core.io.buffer.DataBuffer, org.springframework.core.ResolvableType, org.springframework.util.MimeType, java.util.Map<java.lang.String, java.lang.Object>)
を実装して、DataBuffer
をターゲットのデータ型に変換する方法を提供する必要があります。デフォルトの decode(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer>, org.springframework.core.ResolvableType, org.springframework.util.MimeType, java.util.Map<java.lang.String, java.lang.Object>)
実装は個々のデータバッファーを変換し、decodeToMono(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer>, org.springframework.core.ResolvableType, org.springframework.util.MimeType, java.util.Map<java.lang.String, java.lang.Object>)
は「削減」を適用して集約バッファーを変換します。
サブクラスは、decode(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer>, org.springframework.core.ResolvableType, org.springframework.util.MimeType, java.util.Map<java.lang.String, java.lang.Object>)
をオーバーライドして、入力ストリームを異なる境界に沿って分割したり(たとえば、String
の改行文字で)、常に単一のデータバッファー(Resource
など)に削減したりできます。
logger
修飾子 | コンストラクターと説明 |
---|---|
protected | AbstractDataBufferDecoder(MimeType... supportedMimeTypes) |
修飾子と型 | メソッドと説明 |
---|---|
reactor.core.publisher.Flux<T> | decode(org.reactivestreams.Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, MapSE<StringSE, ObjectSE> hints) DataBuffer 入力ストリームを T の Flux にデコードします。 |
protected abstract T | decodeDataBuffer(DataBuffer buffer, ResolvableType elementType, MimeType mimeType, MapSE<StringSE, ObjectSE> hints) DataBuffer をターゲット要素型にデコードする方法。 |
reactor.core.publisher.Mono<T> | decodeToMono(org.reactivestreams.Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, MapSE<StringSE, ObjectSE> hints) DataBuffer 入力ストリームを T の Mono にデコードします。 |
canDecode, getDecodableMimeTypes, getLogger, setLogger
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
protected AbstractDataBufferDecoder(MimeType... supportedMimeTypes)
public reactor.core.publisher.Flux<T> decode(org.reactivestreams.Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE,ObjectSE> hints)
Decoder
DataBuffer
入力ストリームを T
の Flux にデコードします。input
- デコードする DataBuffer
入力ストリーム elementType
- 出力ストリーム内の要素の予想される型。この型は、事前に Decoder.canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)
メソッドに渡されている必要があり、true
を返している必要があります。mimeType
- 入力ストリームに関連付けられた MIME 型 (オプション)hints
- エンコード方法に関する追加情報 public reactor.core.publisher.Mono<T> decodeToMono(org.reactivestreams.Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE,ObjectSE> hints)
Decoder
DataBuffer
入力ストリームを T
の Mono にデコードします。Decoder<T>
の decodeToMono
AbstractDecoder<T>
の decodeToMono
input
- デコードする DataBuffer
入力ストリーム elementType
- 出力ストリーム内の要素の予想される型。この型は、事前に Decoder.canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)
メソッドに渡されている必要があり、true
を返している必要があります。mimeType
- 入力ストリームに関連付けられた MIME 型 (オプション)hints
- エンコード方法に関する追加情報 protected abstract T decodeDataBuffer(DataBuffer buffer, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE,ObjectSE> hints)
DataBuffer
をターゲット要素型にデコードする方法。