类 AbstractSingleValueEncoder<T>
- java.lang.Object
- org.springframework.core.codec.AbstractEncoder<T>
- org.springframework.core.codec.AbstractSingleValueEncoder<T>
- 类型参数:
T
- the element type
- 所有已实现的接口:
Encoder<T>
- 直接已知子类:
Jaxb2XmlEncoder
,ResourceEncoder
public abstract class AbstractSingleValueEncoder<T> extends AbstractEncoder<T>
Abstract base class forEncoder
classes that can only deal with a single value.- 从以下版本开始:
- 5.0
- 作者:
- Arjen Poutsma
字段概要
从类继承的字段 org.springframework.core.codec.AbstractEncoder
logger
构造器概要
构造器 构造器 说明 AbstractSingleValueEncoder(MimeType... supportedMimeTypes)
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 reactor.core.publisher.Flux<DataBuffer>
encode(org.reactivestreams.Publisher<? extends T> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String,Object> hints)
Encode a stream of Objects of typeT
into aDataBuffer
output stream.protected abstract reactor.core.publisher.Flux<DataBuffer>
encode(T t, DataBufferFactory dataBufferFactory, ResolvableType type, MimeType mimeType, Map<String,Object> hints)
EncodeT
to an outputDataBuffer
stream.从类继承的方法 org.springframework.core.codec.AbstractEncoder
canEncode, getEncodableMimeTypes, getLogger, setLogger
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.core.codec.Encoder
encodeValue
构造器详细资料
AbstractSingleValueEncoder
public AbstractSingleValueEncoder(MimeType... supportedMimeTypes)
方法详细资料
encode
public final reactor.core.publisher.Flux<DataBuffer> encode(org.reactivestreams.Publisher<? extends T> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
从接口复制的说明:Encoder
Encode a stream of Objects of typeT
into aDataBuffer
output stream.- 参数:
inputStream
- the input stream of Objects to encode. If the input should be encoded as a single value rather than as a stream of elements, an instance ofMono
should be used.bufferFactory
- for creating output streamDataBuffer
'selementType
- the expected type of elements in the input stream; this type must have been previously passed to theEncoder.canEncode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)
method and it must have returnedtrue
.mimeType
- the MIME type for the output content (optional)hints
- additional information about how to encode- 返回:
- the output stream
encode
protected abstract reactor.core.publisher.Flux<DataBuffer> encode(T t, DataBufferFactory dataBufferFactory, ResolvableType type, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
EncodeT
to an outputDataBuffer
stream.- 参数:
t
- the value to processdataBufferFactory
- a buffer factory used to create the outputtype
- the stream element type to processmimeType
- the mime type to processhints
- additional information about how to do decode, optional- 返回:
- the output stream