クラス XmlEventDecoder
java.lang.ObjectSE
org.springframework.core.codec.AbstractDecoder<XMLEventSE>
org.springframework.http.codec.xml.XmlEventDecoder
- 実装済みのインターフェース一覧:
Decoder<XMLEventSE>
DataBuffer ストリームを XMLEventsSE のストリームにデコードします。次の XML があるとします。
<root>
<child>foo</child>
<child>bar</child>
</root>
このデコーダーは次のイベントで Flux を生成します。StartDocumentSEStartElementSErootStartElementSEchildCharactersSEfooEndElementSEchildStartElementSEchildCharactersSEbarEndElementSEchildEndElementSEroot
このデコーダーはデフォルトでは登録されていませんが、デフォルトで登録されている他のデコーダーによって内部的に使用されます。
- 導入:
- 5.0
- 作成者:
- Arjen Poutsma, Sam Brannen
ネストされたクラスの概要
ネストされたクラス修飾子と型クラス説明static class上位レベルで発行された XML イベントをバッファリングするXmlEventDecoderの呼び出し元は、受信したバイト総数を監視し、定期的にリセットするために、このトラッカーのインスタンスをBYTE_TRACKER_HINTとして渡すことができます。フィールド概要
フィールド修飾子と型フィールド説明static final StringSEHint key for aXmlEventDecoder.ReceivedByteTrackerinstance that callers can use to track the number of received bytes.クラス AbstractDecoder から継承されたフィールド
loggerコンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明decode(Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE, ObjectSE> hints) DataBuffer入力ストリームをTの Flux にデコードします。intconfiguredバイトカウント制限を返します。voidsetMaxInMemorySize(int byteCount) Set the max number of bytes this decoder should buffer in memory resulting in aDataBufferLimitExceptionwhen the limit is exceeded.クラス AbstractDecoder から継承されたメソッド
canDecode, decodeToMono, getDecodableMimeTypes, getLogger, setLoggerクラス ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース Decoder から継承されたメソッド
decode, getDecodableMimeTypes
フィールドの詳細
BYTE_TRACKER_HINT
Hint key for aXmlEventDecoder.ReceivedByteTrackerinstance that callers can use to track the number of received bytes.
コンストラクターの詳細
XmlEventDecoder
public XmlEventDecoder()
方法の詳細
setMaxInMemorySize
public void setMaxInMemorySize(int byteCount) Set the max number of bytes this decoder should buffer in memory resulting in aDataBufferLimitExceptionwhen the limit is exceeded.When joining all buffers and decoding as a whole, the limit is applied to the entire input.
>When using Aalto XML async parsing, the limit does not apply at the level of this decoder because the XML events parsed from each buffer are emitted immediately and the buffer is released.
デフォルトでは、これは 256K に設定されています。
- パラメーター:
byteCount- バッファリングする最大バイト数、または無制限の場合は -1- 導入:
- 5.1.11
getMaxInMemorySize
decode
public Flux<XMLEventSE> decode(Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE, ObjectSE> hints) インターフェースからコピーされた説明:DecoderDataBuffer入力ストリームをTの Flux にデコードします。- パラメーター:
input- デコードするDataBuffer入力ストリームelementType- 出力ストリーム内の要素の予想される型。この型は、事前にDecoder.canDecode(ResolvableType, MimeType)メソッドに渡されている必要があり、trueを返している必要があります。mimeType- 入力ストリームに関連付けられた MIME 型 (オプション)hints- デコード方法に関する追加情報- 戻り値:
- デコードされた要素を含む出力ストリーム