クラス AbstractJackson2Decoder
java.lang.ObjectSE
org.springframework.http.codec.json.Jackson2CodecSupport
org.springframework.http.codec.json.AbstractJackson2Decoder
- 実装されているすべてのインターフェース:
Decoder<ObjectSE>,HttpMessageDecoder<ObjectSE>
public abstract class AbstractJackson2Decoder
extends Jackson2CodecSupport
implements HttpMessageDecoder<ObjectSE>
ノンブロッキング解析を活用する Jackson 2.x デコードの抽象基本クラス。
- 導入:
- 5.0
- 作成者:
- Sebastien Deleuze, Rossen Stoyanchev, Arjen Poutsma
- 関連事項:
フィールドのサマリー
クラス org.springframework.http.codec.json.Jackson2CodecSupport から継承されたフィールド
JSON_VIEW_HINT, loggerコンストラクターの概要
コンストラクター修飾子コンストラクター説明protectedAbstractJackson2Decoder(ObjectMapper mapper, MimeType... mimeTypes) 使用する JacksonObjectMapperを持つコンストラクター。メソッドのサマリー
修飾子と型メソッド説明booleancanDecode(ResolvableType elementType, MimeType mimeType) デコーダーが特定のターゲット要素型とソースストリームの MIME 型をサポートするかどうか。protected ObjectReadercustomizeReader(ObjectReader reader, ResolvableType elementType, MapSE<StringSE, ObjectSE> hints) サブクラスは、このメソッドを使用して、値の読み取りに使用されるObjectReaderをカスタマイズできます。reactor.core.publisher.Flux<ObjectSE>decode(Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, MapSE<StringSE, ObjectSE> hints) DataBuffer入力ストリームをTの Flux にデコードします。decode(DataBuffer dataBuffer, ResolvableType targetType, MimeType mimeType, MapSE<StringSE, ObjectSE> hints) データバッファを型 T のオブジェクトにデコードします。reactor.core.publisher.Mono<ObjectSE>decodeToMono(Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, MapSE<StringSE, ObjectSE> hints) DataBuffer入力ストリームをTの Mono にデコードします。protected <A extends AnnotationSE>
AgetAnnotation(MethodParameter parameter, ClassSE<A> annotType) このデコーダーでサポートされている MIME 型のリストを返します。getDecodableMimeTypes(ResolvableType targetType) 指定された型の要素について、このデコーダーでサポートされている MIME 型のリストを返します。getDecodeHints(ResolvableType actualType, ResolvableType elementType, ServerHttpRequest request, ServerHttpResponse response) サーバーリクエストまたはターゲットコントローラーメソッドパラメーターのアノテーションに基づいてデコードヒントを取得します。intconfiguredバイトカウント制限を返します。protected reactor.core.publisher.Flux<DataBuffer>processInput(Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, MapSE<StringSE, ObjectSE> hints) 入力パブリッシャーを flux に処理します。voidsetMaxInMemorySize(int byteCount) このデコーダーでバッファーできる最大バイト数を設定します。クラス org.springframework.http.codec.json.Jackson2CodecSupport から継承されたメソッド
getHints, getJavaType, getMediaTypesForProblemDetail, getMimeTypes, getMimeTypes, getObjectMapper, getObjectMapperRegistrations, getObjectMappersForType, getParameter, logWarningIfNecessary, registerObjectMappersForType, selectObjectMapper, setObjectMapper, supportsMimeType
コンストラクターの詳細
AbstractJackson2Decoder
使用する JacksonObjectMapperを持つコンストラクター。
メソッドの詳細
setMaxInMemorySize
public void setMaxInMemorySize(int byteCount) このデコーダーでバッファーできる最大バイト数を設定します。これは、全体としてデコードするときの入力全体のサイズ、または JSON ストリーム内の 1 つのトップレベル JSON オブジェクトのサイズのいずれかです。制限を超えると、DataBufferLimitExceptionが発生します。デフォルトでは、これは 256K に設定されています。
- パラメーター:
byteCount- バッファリングする最大バイト数、または無制限の場合は -1- 導入:
- 5.1.11
getMaxInMemorySize
public int getMaxInMemorySize()configuredバイトカウント制限を返します。- 導入:
- 5.1.11
canDecode
インターフェースからコピーされた説明:Decoderデコーダーが特定のターゲット要素型とソースストリームの MIME 型をサポートするかどうか。decode
public reactor.core.publisher.Flux<ObjectSE> decode(Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE, ObjectSE> hints) インターフェースからコピーされた説明:DecoderDataBuffer入力ストリームをTの Flux にデコードします。- 次で指定:
- インターフェース
Decoder<ObjectSE>のdecode - パラメーター:
input- デコードするDataBuffer入力ストリームelementType- 出力ストリーム内の要素の予想される型。この型は、事前にDecoder.canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)メソッドに渡されている必要があり、trueを返している必要があります。mimeType- 入力ストリームに関連付けられた MIME 型 (オプション)hints- デコード方法に関する追加情報- 戻り値:
- デコードされた要素を含む出力ストリーム
processInput
protected reactor.core.publisher.Flux<DataBuffer> processInput(Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE, ObjectSE> hints) 入力パブリッシャーを flux に処理します。デフォルトの実装ではFlux.from(Publisher)が返されますが、サブクラスではこの動作をカスタマイズできます。- パラメーター:
input- 処理するDataBuffer入力ストリームelementType- 出力ストリームで予期される要素の型mimeType- 入力ストリームに関連付けられた MIME 型 (オプション)hints- エンコード方法に関する追加情報- 戻り値:
- 処理された flux
- 導入:
- 5.1.14
decodeToMono
public reactor.core.publisher.Mono<ObjectSE> decodeToMono(Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE, ObjectSE> hints) インターフェースからコピーされた説明:DecoderDataBuffer入力ストリームをTの Mono にデコードします。- 次で指定:
- インターフェース
Decoder<ObjectSE>のdecodeToMono - パラメーター:
input- デコードするDataBuffer入力ストリームelementType- 出力ストリーム内の要素の予想される型。この型は、事前にDecoder.canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)メソッドに渡されている必要があり、trueを返している必要があります。mimeType- 入力ストリームに関連付けられた MIME 型 (オプション)hints- デコード方法に関する追加情報- 戻り値:
- デコードされた要素を持つ出力ストリーム
decode
public ObjectSE decode(DataBuffer dataBuffer, ResolvableType targetType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE, ObjectSE> hints) throws DecodingExceptionインターフェースからコピーされた説明:Decoderデータバッファーを型 T のオブジェクトにデコードします。これは、個別のメッセージ(またはイベント)が完全に集約された形式で個別にデコードおよび処理されるシナリオで役立ちます。- 次で指定:
- インターフェース
Decoder<ObjectSE>のdecode - パラメーター:
dataBuffer- デコードするDataBuffertargetType- 予想される出力型mimeType- データに関連付けられた MIME 型hints- デコード方法に関する追加情報- 戻り値:
- デコードされた値、おそらく
null - 例外:
DecodingException
customizeReader
protected ObjectReader customizeReader(ObjectReader reader, ResolvableType elementType, @Nullable MapSE<StringSE, ObjectSE> hints) サブクラスは、このメソッドを使用して、値の読み取りに使用されるObjectReaderをカスタマイズできます。- パラメーター:
reader- カスタマイズするリーダーインスタンスelementType- 読み取る対象の要素値の型hints- 直列化のヒントを含むマップ。Reactor コンテキストは、利用可能な場合、キーContextView.class.getName()でアクセスできます。- 戻り値:
- 使用するカスタマイズされた
ObjectReader - 導入:
- 6.0
getDecodeHints
public MapSE<StringSE,ObjectSE> getDecodeHints(ResolvableType actualType, ResolvableType elementType, ServerHttpRequest request, ServerHttpResponse response) インターフェースからコピーされた説明:HttpMessageDecoderサーバーリクエストまたはターゲットコントローラーメソッドパラメーターのアノテーションに基づいてデコードヒントを取得します。- 次で指定:
- インターフェース
HttpMessageDecoder<ObjectSE>のgetDecodeHints - パラメーター:
actualType- デコード先の実際のターゲット型、場合によってはリアクティブラッパーであり、MethodParameterから供給されます。つまり、メソッドパラメーターアノテーションへのアクセスを提供しますelementType- デコードしようとしているFlux/Mono内の要素型request- 現在のリクエストresponse- 現在のレスポンス- 戻り値:
- ヒントがあるマップ、空の場合もある
getDecodableMimeTypes
インターフェースからコピーされた説明:Decoderこのデコーダーでサポートされている MIME 型のリストを返します。このリストは、考えられるすべてのターゲット要素型に適用されるとは限らないため、このメソッドの呼び出しは通常、canDecode(elementType, null)を介して保護する必要があります。このリストでは、特定の要素型でのみサポートされている MIME 型を除外することもできます。または、Decoder.getDecodableMimeTypes(ResolvableType)を使用してより正確なリストを作成します。- 次で指定:
- インターフェース
Decoder<ObjectSE>のgetDecodableMimeTypes - 戻り値:
- サポートされている MIME 型のリスト
getDecodableMimeTypes
インターフェースからコピーされた説明:Decoder指定された型の要素について、このデコーダーでサポートされている MIME 型のリストを返します。このリストは、デコーダーが特定の要素型をサポートしていない場合、または MIME 型のサブセットに対してのみサポートしている場合、Decoder.getDecodableMimeTypes()とは異なる場合があります。- 次で指定:
- インターフェース
Decoder<ObjectSE>のgetDecodableMimeTypes - パラメーター:
targetType- デコードをチェックする要素の型- 戻り値:
- 特定のターゲット型でサポートされている MIME 型のリスト
getAnnotation
@Nullable protected <A extends AnnotationSE> A getAnnotation(MethodParameter parameter, ClassSE<A> annotType) - 次で指定:
- クラス
Jackson2CodecSupportのgetAnnotation