クラス XmlEventDecoder

java.lang.ObjectSE
org.springframework.core.codec.AbstractDecoder<XMLEventSE>
org.springframework.http.codec.xml.XmlEventDecoder
実装済みのインターフェース一覧:
Decoder<XMLEventSE>

public class XmlEventDecoder extends AbstractDecoder<XMLEventSE>
DataBuffer ストリームを XMLEventsSE のストリームにデコードします。

次の XML があるとします。

<root>
    <child>foo</child>
    <child>bar</child>
</root>
このデコーダーは次のイベントで Flux を生成します。
  1. StartDocumentSE
  2. StartElementSE root
  3. StartElementSE child
  4. CharactersSE foo
  5. EndElementSE child
  6. StartElementSE child
  7. CharactersSE bar
  8. EndElementSE child
  9. EndElementSE root

このデコーダーはデフォルトでは登録されていませんが、デフォルトで登録されている他のデコーダーによって内部的に使用されます。

導入:
5.0
作成者:
Arjen Poutsma, Sam Brannen
  • フィールドの詳細

  • コンストラクターの詳細

    • XmlEventDecoder

      public XmlEventDecoder()
  • 方法の詳細

    • setMaxInMemorySize

      public void setMaxInMemorySize(int byteCount)
      Set the max number of bytes this decoder should buffer in memory resulting in a DataBufferLimitException when 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

      public int getMaxInMemorySize()
      configured バイトカウント制限を返します。
      導入:
      5.1.11
    • decode

      public Flux<XMLEventSE> decode(Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE,ObjectSE> hints)
      インターフェースからコピーされた説明: Decoder
      DataBuffer 入力ストリームを T の Flux にデコードします。
      パラメーター:
      input - デコードする DataBuffer 入力ストリーム
      elementType - 出力ストリーム内の要素の予想される型。この型は、事前に Decoder.canDecode(ResolvableType, MimeType) メソッドに渡されている必要があり、true を返している必要があります。
      mimeType - 入力ストリームに関連付けられた MIME 型 (オプション)
      hints - デコード方法に関する追加情報
      戻り値:
      デコードされた要素を含む出力ストリーム