public class Jaxb2XmlDecoder extends AbstractDecoder<Object>
Objects (POJOs).Jaxb2XmlEncoderlogger| Constructor and Description |
|---|
Jaxb2XmlDecoder() |
Jaxb2XmlDecoder(MimeType... supportedMimeTypes)
Create a
Jaxb2XmlDecoder with the specified MIME types. |
| 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.Flux<Object> |
decode(org.reactivestreams.Publisher<DataBuffer> inputStream,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints)
Decode a
DataBuffer input stream into a Flux of T. |
reactor.core.publisher.Mono<Object> |
decodeToMono(org.reactivestreams.Publisher<DataBuffer> inputStream,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints)
Decode a
DataBuffer input stream into a Mono of T. |
int |
getMaxInMemorySize()
Return the
configured byte count limit. |
Function<Unmarshaller,Unmarshaller> |
getUnmarshallerProcessor()
Return the configured processor for customizing Unmarshaller instances.
|
void |
setMaxInMemorySize(int byteCount)
Set the max number of bytes that can be buffered by this decoder.
|
void |
setUnmarshallerProcessor(Function<Unmarshaller,Unmarshaller> processor)
Configure a processor function to customize Unmarshaller instances.
|
getDecodableMimeTypes, getLogger, setLoggerpublic Jaxb2XmlDecoder()
public Jaxb2XmlDecoder(MimeType... supportedMimeTypes)
Jaxb2XmlDecoder with the specified MIME types.supportedMimeTypes - supported MIME typespublic void setUnmarshallerProcessor(Function<Unmarshaller,Unmarshaller> processor)
processor - the function to usepublic Function<Unmarshaller,Unmarshaller> getUnmarshallerProcessor()
public void setMaxInMemorySize(int byteCount)
DataBufferLimitException is raised.
By default in 5.1 this is set to -1, unlimited. In 5.2 the default value for this limit is set to 256K.
byteCount - the max number of bytes to buffer, or -1 for unlimitedpublic int getMaxInMemorySize()
configured byte count limit.public boolean canDecode(ResolvableType elementType, @Nullable MimeType mimeType)
DecodercanDecode in interface Decoder<Object>canDecode in class AbstractDecoder<Object>elementType - the target element type for the output streammimeType - the mime type associated with the stream to decode
(can be null if not specified)true if supported, false otherwisepublic reactor.core.publisher.Flux<Object> decode(org.reactivestreams.Publisher<DataBuffer> inputStream, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
DecoderDataBuffer input stream into a Flux of 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 encodepublic reactor.core.publisher.Mono<Object> decodeToMono(org.reactivestreams.Publisher<DataBuffer> inputStream, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
DecoderDataBuffer input stream into a Mono of T.decodeToMono in interface Decoder<Object>decodeToMono in class AbstractDecoder<Object>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 encode