public final class StringDecoder extends AbstractDataBufferDecoder<StringSE>
String
ストリームにデコードします。デコードする前に、このデコーダーは受信データバッファーを再調整して、各バッファーが改行で終了するようにします。これは、マルチバイト文字が適切にデコードされ、バッファの境界を越えないようにするためです。デフォルトの区切り文字(\n
、\r\n
)はカスタマイズできます。Netty の DelimiterBasedFrameDecoder
に部分的に触発されています。
CharSequenceEncoder
修飾子と型 | フィールドと説明 |
---|---|
static CharsetSE | DEFAULT_CHARSET 使用するデフォルトの文字セット、つまり |
static ListSE<StringSE> | DEFAULT_DELIMITERS 使用するデフォルトの区切り文字列。 |
logger
修飾子と型 | メソッドと説明 |
---|---|
static StringDecoder | allMimeTypes() すべての MIME 型をサポートする StringDecoder を作成します。 |
static StringDecoder | allMimeTypes(boolean ignored) 使用すべきではありません。 Spring 5.0.4 以降、 allMimeTypes() または allMimeTypes(List, boolean) を優先 |
static StringDecoder | allMimeTypes(ListSE<StringSE> delimiters, boolean stripDelimiter) すべての MIME 型をサポートする StringDecoder を作成します。 |
boolean | canDecode(ResolvableType elementType, MimeType mimeType) デコーダーが特定のターゲット要素型とソースストリームの MIME 型をサポートするかどうか。 |
reactor.core.publisher.Flux<StringSE> | decode(org.reactivestreams.Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, MapSE<StringSE, ObjectSE> hints) DataBuffer 入力ストリームを T の Flux にデコードします。 |
protected StringSE | decodeDataBuffer(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, MapSE<StringSE, ObjectSE> hints) DataBuffer をターゲット要素型にデコードする方法。 |
static StringDecoder | textPlainOnly() "text/plain" の StringDecoder を作成します。 |
static StringDecoder | textPlainOnly(boolean ignored) 使用すべきではありません。 Spring 5.0.4 以降、 textPlainOnly() または textPlainOnly(List, boolean) を優先 |
static StringDecoder | textPlainOnly(ListSE<StringSE> delimiters, boolean stripDelimiter) "text/plain" の StringDecoder を作成します。 |
decodeToMono
getDecodableMimeTypes, getLogger, setLogger
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public static final CharsetSE DEFAULT_CHARSET
public boolean canDecode(ResolvableType elementType, @Nullable MimeType mimeType)
Decoder
public reactor.core.publisher.Flux<StringSE> decode(org.reactivestreams.Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE,ObjectSE> hints)
Decoder
DataBuffer
入力ストリームを T
の Flux にデコードします。Decoder<StringSE>
の decode
AbstractDataBufferDecoder<StringSE>
の decode
input
- デコードする DataBuffer
入力ストリーム elementType
- 出力ストリーム内の要素の予想される型。この型は、事前に Decoder.canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)
メソッドに渡されている必要があり、true
を返している必要があります。mimeType
- 入力ストリームに関連付けられた MIME 型 (オプション)hints
- エンコード方法に関する追加情報 protected StringSE decodeDataBuffer(DataBuffer dataBuffer, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable MapSE<StringSE,ObjectSE> hints)
AbstractDataBufferDecoder
DataBuffer
をターゲット要素型にデコードする方法。AbstractDataBufferDecoder<StringSE>
の decodeDataBuffer
@DeprecatedSE public static StringDecoder textPlainOnly(boolean ignored)
textPlainOnly()
または textPlainOnly(List, boolean)
を優先 "text/plain"
の StringDecoder
を作成します。ignored
- 無視されました public static StringDecoder textPlainOnly()
"text/plain"
の StringDecoder
を作成します。public static StringDecoder textPlainOnly(ListSE<StringSE> delimiters, boolean stripDelimiter)
"text/plain"
の StringDecoder
を作成します。delimiters
- 入力ストリームを分割するために使用する区切り文字列 stripDelimiter
- 結果の入力文字列から区切り文字を削除するかどうか @DeprecatedSE public static StringDecoder allMimeTypes(boolean ignored)
allMimeTypes()
または allMimeTypes(List, boolean)
を優先 StringDecoder
を作成します。ignored
- 無視されました public static StringDecoder allMimeTypes()
StringDecoder
を作成します。public static StringDecoder allMimeTypes(ListSE<StringSE> delimiters, boolean stripDelimiter)
StringDecoder
を作成します。delimiters
- 入力ストリームを分割するために使用する区切り文字列 stripDelimiter
- 結果の入力文字列から区切り文字を削除するかどうか