クラス SseUtils
java.lang.ObjectSE
org.springframework.web.util.SseUtils
サーブレットとリアクティブ SSE サポートで共有される、コンテンツをサーバー送信イベントとして書き込むためのユーティリティメソッド。
- 導入:
- 7.0.9
- 作成者:
- Brian Clozel
コンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明static voidappendFieldValue(StringSE field, StringSE value, StringBuilderSE output) valueをoutputに追加し、outputに含まれる各行セパレーター ("\n"、"\r"、"\r\n") を新しいfield行 (つまり"\n" + field + ":") に置き換えます。static voidassertNoLineSeparator(StringSE content) 指定された単一行の SSE フィールド値(idまたはevent名など)に、行セパレーターが含まれていないことを検証します。
コンストラクターの詳細
SseUtils
public SseUtils()
方法の詳細
appendFieldValue
Appendvaluetooutput, replacing each line separator ("\n","\r", or"\r\n") it contains with a newfieldline (that is,"\n" + field + ":"). This keeps a multi-line field value from breaking out of the current SSE field when written on the wire.- パラメーター:
field- the name of the SSE field thatvaluebelongs to (for example,"data"), or an empty string for a commentvalue- the field value to escape and appendoutput- theStringBuilderto append the escaped value to
assertNoLineSeparator
指定された単一行の SSE フィールド値(idまたはevent名など)に、行セパレーターが含まれていないことを検証します。- パラメーター:
content- the field value to check- 例外:
IllegalArgumentExceptionSE- ifcontentcontains"\n"or"\r"