T
- the element typepublic abstract class AbstractDecoder<T> extends Object implements Decoder<T>
Decoder
implementations.Modifier | Constructor and Description |
---|---|
protected |
AbstractDecoder(MimeType... supportedMimeTypes) |
Modifier and Type | Method and Description |
---|---|
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(Publisher<DataBuffer> inputStream,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints)
Decode a
DataBuffer input stream into a Mono of T . |
List<MimeType> |
getDecodableMimeTypes()
Return the list of MIME types supported by this Decoder.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decode, decode, getDecodableMimeTypes
protected Log logger
protected AbstractDecoder(MimeType... supportedMimeTypes)
public void setLogger(Log logger)
logger
- the logger to usepublic Log getLogger()
public List<MimeType> getDecodableMimeTypes()
Decoder
canDecode(elementType, null)
. The list may also exclude MIME types
supported only for a specific element type. Alternatively, use
Decoder.getDecodableMimeTypes(ResolvableType)
for a more precise list.getDecodableMimeTypes
in interface Decoder<T>
public boolean canDecode(ResolvableType elementType, @Nullable MimeType mimeType)
Decoder
public reactor.core.publisher.Mono<T> decodeToMono(Publisher<DataBuffer> inputStream, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
Decoder
DataBuffer
input stream into a Mono of T
.decodeToMono
in interface Decoder<T>
inputStream
- the DataBuffer
input stream to decodeelementType
- the expected type of elements in the output stream;
this type must have been previously passed to the Decoder.canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)
method and it must have returned true
.mimeType
- the MIME type associated with the input stream (optional)hints
- additional information about how to do decode