クラス SseUtils

java.lang.ObjectSE
org.springframework.web.util.SseUtils

public abstract class SseUtils extends ObjectSE
サーブレットとリアクティブ SSE サポートで共有される、コンテンツをサーバー送信イベントとして書き込むためのユーティリティメソッド。
導入:
7.0.9
作成者:
Brian Clozel
  • コンストラクター概要

    コンストラクター
    コンストラクター
    説明
  • 方法の概要

    修飾子と型
    メソッド
    説明
    static void
    value を output に追加し、output に含まれる各行セパレーター ("\n""\r""\r\n") を新しい field 行 (つまり "\n" + field + ":") に置き換えます。
    static void
    指定された単一行の SSE フィールド値(id または event 名など)に、行セパレーターが含まれていないことを検証します。

    クラス ObjectSE から継承されたメソッド

    clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
  • コンストラクターの詳細

    • SseUtils

      public SseUtils()
  • 方法の詳細

    • appendFieldValue

      public static void appendFieldValue(StringSE field, StringSE value, StringBuilderSE output)
      Append value to output, replacing each line separator ("\n""\r", or "\r\n") it contains with a new field line (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 that value belongs to (for example, "data"), or an empty string for a comment
      value - the field value to escape and append
      output - the StringBuilder to append the escaped value to
    • assertNoLineSeparator

      public static void assertNoLineSeparator(StringSE content)
      指定された単一行の SSE フィールド値(id または event 名など)に、行セパレーターが含まれていないことを検証します。
      パラメーター:
      content - the field value to check
      例外:
      IllegalArgumentExceptionSE - if content contains "\n" or "\r"