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
ConstructorsConstructorDescriptionJStachioEncoder(JStachio jstachio) Create the encoder from a JStachioJStachioEncoder(JStachio jstachio, int allocateBufferSize) Create the encoder from a JStachio -
Method Summary
Modifier and TypeMethodDescriptionbooleancanEncode(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
encodeMethods inherited from class org.springframework.core.codec.AbstractEncoder
getEncodableMimeTypes, getLogger, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
encodein classAbstractSingleValueEncoder<Object>
-
encodeValue
public DataBuffer encodeValue(Object event, DataBufferFactory bufferFactory, ResolvableType valueType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints)
-