类 AbstractCharSequenceDecoder<T extends CharSequence>
java.lang.Object
cn.taketoday.core.codec.AbstractDecoder<T>
cn.taketoday.core.codec.AbstractDataBufferDecoder<T>
cn.taketoday.core.codec.AbstractCharSequenceDecoder<T>
- 类型参数:
T- the character sequence type
- 所有已实现的接口:
Decoder<T>
- 直接已知子类:
CharBufferDecoder,StringDecoder
public abstract class AbstractCharSequenceDecoder<T extends CharSequence>
extends AbstractDataBufferDecoder<T>
Abstract base class that decodes from a data buffer stream to a
CharSequence stream.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma, Harry Yang
-
字段概要
字段修饰符和类型字段说明The default delimiter strings to use, i.e.private Charsetprivate final ConcurrentHashMap<Charset,byte[][]> private final boolean从类继承的字段 cn.taketoday.core.codec.AbstractDecoder
logger -
构造器概要
构造器限定符构造器说明protectedAbstractCharSequenceDecoder(List<String> delimiters, boolean stripDelimiter, MimeType... mimeTypes) Create a newAbstractCharSequenceDecoderwith the given parameters. -
方法概要
修饰符和类型方法说明final Tdecode(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) Decode a data buffer to an Object of type T.final reactor.core.publisher.Flux<T>decode(org.reactivestreams.Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) Decode aDataBufferinput stream into a Flux ofT.protected abstract TdecodeInternal(DataBuffer dataBuffer, Charset charset) Template method that decodes the given data buffer intoT, given the charset.private CharsetgetCharset(MimeType mimeType) Return the configureddefaultCharset.private byte[][]getDelimiterBytes(MimeType mimeType) private Collection<DataBuffer>processDataBuffer(DataBuffer buffer, DataBufferUtils.Matcher matcher, LimitedDataBufferList chunks) voidsetDefaultCharset(Charset defaultCharset) Set the default character set to fall back on if the MimeType does not specify any.从类继承的方法 cn.taketoday.core.codec.AbstractDataBufferDecoder
decodeToMono, getMaxInMemorySize, setMaxInMemorySize从类继承的方法 cn.taketoday.core.codec.AbstractDecoder
canDecode, getDecodableMimeTypes, getLogger, setLogger从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.core.codec.Decoder
getDecodableMimeTypes
-
字段详细资料
-
DEFAULT_DELIMITERS
The default delimiter strings to use, i.e.\r\nand\n. -
delimiters
-
stripDelimiter
private final boolean stripDelimiter -
defaultCharset
-
delimitersCache
-
-
构造器详细资料
-
方法详细资料
-
setDefaultCharset
Set the default character set to fall back on if the MimeType does not specify any.By default this is
UTF-8.- 参数:
defaultCharset- the charset to fall back on
-
getDefaultCharset
Return the configureddefaultCharset. -
decode
public final reactor.core.publisher.Flux<T> decode(org.reactivestreams.Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) 从接口复制的说明:DecoderDecode aDataBufferinput stream into a Flux ofT.- 指定者:
decode在接口中Decoder<T extends CharSequence>- 覆盖:
decode在类中AbstractDataBufferDecoder<T extends CharSequence>- 参数:
input- theDataBufferinput stream to decodeelementType- the expected type of elements in the output stream; this type must have been previously passed to theDecoder.canDecode(cn.taketoday.core.ResolvableType, cn.taketoday.util.MimeType)method and it must have returnedtrue.mimeType- the MIME type associated with the input stream (optional)hints- additional information about how to do decode- 返回:
- the output stream with decoded elements
-
getDelimiterBytes
-
processDataBuffer
private Collection<DataBuffer> processDataBuffer(DataBuffer buffer, DataBufferUtils.Matcher matcher, LimitedDataBufferList chunks) -
decode
public final T decode(DataBuffer dataBuffer, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) 从接口复制的说明:DecoderDecode a data buffer to an Object of type T. This is useful for scenarios, that distinct messages (or events) are decoded and handled individually, in fully aggregated form.- 参数:
dataBuffer- theDataBufferto decodeelementType- the expected output typemimeType- the MIME type associated with the datahints- additional information about how to do decode- 返回:
- the decoded value, possibly
null
-
getCharset
-
decodeInternal
Template method that decodes the given data buffer intoT, given the charset.
-