java.lang.Object
org.springframework.core.codec.AbstractEncoder<T>
org.springframework.core.codec.AbstractSingleValueEncoder<Object>
io.jstach.opt.spring.webflux.JStachioEncoder
Encodes a JStachio model into a bytes to be used as output from a webflux reactive
controller.
- Author:
- agentgt, dsyer
-
Field Summary
Fields inherited from class org.springframework.core.codec.AbstractEncoder
logger
-
Constructor Summary
ConstructorDescriptionJStachioEncoder
(JStachio jstachio) Create the encoder from a JStachioJStachioEncoder
(JStachio jstachio, int allocateBufferSize) Create the encoder from a JStachio -
Method Summary
Modifier and TypeMethodDescriptionboolean
canEncode
(ResolvableType elementType, @Nullable MimeType mimeType) protected reactor.core.publisher.Flux<DataBuffer>
encode
(Object event, DataBufferFactory bufferFactory, ResolvableType type, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) encodeValue
(Object event, DataBufferFactory bufferFactory, ResolvableType valueType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) Methods inherited from class org.springframework.core.codec.AbstractSingleValueEncoder
encode
Methods inherited from class org.springframework.core.codec.AbstractEncoder
getEncodableMimeTypes, getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.codec.Encoder
getEncodableMimeTypes
-
Constructor Details
-
JStachioEncoder
Create the encoder from a JStachio- Parameters:
jstachio
- notnull
.
-
JStachioEncoder
Create the encoder from a JStachio- Parameters:
jstachio
- notnull
.allocateBufferSize
- how much to initially allocate from the buffer factory
-
-
Method Details
-
canEncode
-
encode
protected reactor.core.publisher.Flux<DataBuffer> encode(Object event, DataBufferFactory bufferFactory, ResolvableType type, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) - Specified by:
encode
in classAbstractSingleValueEncoder<Object>
-
encodeValue
public DataBuffer encodeValue(Object event, DataBufferFactory bufferFactory, ResolvableType valueType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints)
-