类 AbstractDecoder<T>
- java.lang.Object
- org.springframework.core.codec.AbstractDecoder<T>
- 类型参数:
T
- the element type
- 所有已实现的接口:
Decoder<T>
public abstract class AbstractDecoder<T> extends Object implements Decoder<T>
Abstract base class forDecoder
implementations.- 从以下版本开始:
- 5.0
- 作者:
- Sebastien Deleuze, Arjen Poutsma
构造器概要
构造器 限定符 构造器 说明 protected
AbstractDecoder(MimeType... supportedMimeTypes)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
canDecode(ResolvableType elementType, MimeType mimeType)
Whether the decoder supports the given target element type and the MIME type of the source stream.reactor.core.publisher.Mono<T>
decodeToMono(org.reactivestreams.Publisher<DataBuffer> inputStream, ResolvableType elementType, MimeType mimeType, Map<String,Object> hints)
Decode aDataBuffer
input stream into a Mono ofT
.List<MimeType>
getDecodableMimeTypes()
Return the list of MIME types this decoder supports.Log
getLogger()
Return the currently configured Logger.void
setLogger(Log logger)
Set an alternative logger to use than the one based on the class name.
构造器详细资料
AbstractDecoder
protected AbstractDecoder(MimeType... supportedMimeTypes)
方法详细资料
setLogger
public void setLogger(Log logger)
Set an alternative logger to use than the one based on the class name.- 参数:
logger
- the logger to use- 从以下版本开始:
- 5.1
getDecodableMimeTypes
public List<MimeType> getDecodableMimeTypes()
从接口复制的说明:Decoder
Return the list of MIME types this decoder supports.- 指定者:
getDecodableMimeTypes
在接口中Decoder<T>
canDecode
public boolean canDecode(ResolvableType elementType, @Nullable MimeType mimeType)
从接口复制的说明:Decoder
Whether the decoder supports the given target element type and the MIME type of the source stream.
decodeToMono
public reactor.core.publisher.Mono<T> decodeToMono(org.reactivestreams.Publisher<DataBuffer> inputStream, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
从接口复制的说明:Decoder
Decode aDataBuffer
input stream into a Mono ofT
.- 指定者:
decodeToMono
在接口中Decoder<T>
- 参数:
inputStream
- theDataBuffer
input stream to decodeelementType
- the expected type of elements in the output stream; this type must have been previously passed to theDecoder.canDecode(org.springframework.core.ResolvableType, org.springframework.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 encode- 返回:
- the output stream with the decoded element